如果我以前没有安装PHP,一切都OK。 当我从5.4.36升级到5.4.38,它说PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled. 然后在bin里没有pecl 。 我必须通过wget http://pear.php.net/go-pear.phar && php go-pear.phar手动安装,但是go-pear.phar不支持cli param,所以我必须手动按enter键以继续梨的安装。 我希望梨可以自动安装,我该怎么办?
我已经在我的VPS上启用了Mod_Security,它使用apache web服务器运行Ubuntu操作系统。 现在,我想禁用它,因为我设置了另一个防火墙来保护我的服务器。 我已经尝试了以相反的顺序执行这些步骤(取出代码行和禁用模块),但是当我尝试重新启动Apache时,它一直说它无法重新启动。 我一直在寻找,但我无法find如何禁用WAF。 任何帮助,将不胜感激!
我有一个关于nginx tune的问题。 我有一个应用程序,我想每秒执行200次。 我创build了bash文件,并使用wget和bqO开关执行。 但它有一个问题。 当请求的数量大于100. nginx不响应另一个请求,并在加载完成之前一直存在。 但是,我设置pm.max_children并将worker_connections设置为200。 你有任何build议来解决这个问题,还是有任何调谐器,如“MySQL调谐器”调谐nginx。 我的configuration:php-fpm55.conf: pm = ondemand pm.max_children = 1024 pm.start_servers = 20 pm.min_spare_servers = 20 pm.max_spare_servers = 35 pm.max_requests = 256 pm.process_idle_timeout = 20 net.core.somaxconn = 4096 sysctl.conf的: net.ipv4.tcp_window_scaling = 1 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.ipv4.tcp_rmem = 4096 87380 16777216 net.ipv4.tcp_wmem = 4096 65536 16777216 net.ipv4.ip_local_port_range […]
我们的Linux CentOS6机器上有5.3.3和5.6.7两个版本的PHP,并且希望将PHP扩展memcache和imagick安装到5.6.7。 以root身份login,使用yum,我们安装了这两个,但是意识到它们只能在5.3.3中使用,而不能在最新版本中使用。 这是我们使用的命令: $ yum install ImageMagick ImageMagick-devel $ pecl install imagick $ echo "extension=imagick.so" > /etc/php.d/imagick.ini 我们尝试将imagick.so和memcache.so从旧的扩展目录复制到5.6.7的扩展目录,但没有任何运气。 我们如何将这些扩展安装到我们的最新版本PHP 5.6.7? 或者有没有办法解决这个问题,而不重新安装任何东西? 编辑: 要安装PHP 5.6.7,我使用了这个要点给出的步骤: https://gist.github.com/Stayallive/dbb91ffa6f0fc6ca6ac3
在两个php.ini文件(Apache的和普通sudo updatedb && locate php.ini : sudo updatedb && locate php.ini )中添加了以下Dynamic Extensions : extension=raphf.so extension=propro.so extension=http.so 冉以下安装,这一切工作: sudo apt-get install libpcre3-dev php5-dev php-pear sudo pecl channel-update pecl.php.net sudo pecl install pecl_http 然而,testing仍然失败 php -r 'http_post_data();' PHP Fatal error: Call to undefined function http_post_data() in Command line code on line 1 PHP Stack trace: PHP […]
RHEL 7.1随PHP 5.4一起发布,并且该版本即将退出支持。 根据历史趋势,将RHEL升级到PHP的一个新的主要版本? UPDATE RHEL 7.1 – PHP 5.4.16 RHEL 7.0 – PHP 5.4.16 RHEL 6.5 – PHP 5.3.3 RHEL 6.0 – PHP 5.3.2 RHEL 5.10 – PHP 5.1.6 RHEL 5.0 – PHP 5.1.6 RHEL 4.9 – PHP 4.3.9 RHEL 4.0 – PHP 4.3.9
我有以下代码redirect访问login.php的用户到另一个页面: http { …. geo $bad_user { default 0; 1.2.3.4/32 1; 4.3.2.1/32 1; } server { …. location = /login.php { if ($bad_user) { rewrite ^ http://example.com/foo.php; } } } } 它会下载login.php文件,而不是将用户redirect到其他页面。 所有其他的PHP文件正在工作,除了该文件(login.php)。 如果我删除上面的代码,它工作正常,但它不会redirect。 我尝试了以下内容: rewrite ^ http://example.com/foo.php last; & rewrite ^ http://example.com/foo.php$1 last; 但是他们都没有为我工作。 我也重新启动整个服务器,但它没有工作。 有什么build议吗?
现在我已经把我的头撞到墙上了几天了。 我只是无法弄清楚。 我用plesk 12和apache 2.2运行Ubuntu 12。 我已经尝试编译PHP 5.6.10和PHP 5.6.11与这两个选项的变种: ./configure –prefix=/opt/php-5.6.11-apache –with-config-file-path=/opt/php-5.6.11-apache/etc –disable-debug –enable-roxen-zts –enable-short-tags –enable-magic-quotes –enable-sigchild –enable-libgcc –with-libdir=/lib/x86_64-linux-gnu –with-openssl –with-openssl-dir=/usr/bin –with-zlib –enable-bcmath –with-bz2 –enable-calendar –enable-ctype –with-curl=/usr/bin –with-cdb –enable-inifile –enable-flatfile –enable-dba –with-xsl –enable-dom –enable-exif –enable-filter –enable-ftp –with-gd –with-png-dir=/usr –with-jpeg-dir=/usr –enable-gd-native-ttf –with-freetype-dir=/usr –with-gettext –with-gmp –enable-hash –with-iconv –with-imap –with-imap-ssl –with-kerberos –with-ldap –enable-mbstring –enable-mbregex –enable-mbregex-backtrack –with-mcrypt=/usr –with-mhash –with-mysql […]
我有一个Ubuntu 12.04服务器,我试图build立一个MSSQL数据库的连接。 我设法使用tsql和isql连接,但osql不工作,并使用PDO与PHP连接也无法正常工作..我会尽量提供尽可能多的信息,如果你需要更多的只是让我知道我将编辑。 freetds.conf : [MSSQL] host = TPSACC port = 54488 tds version = 8.0 odbc.ini : [MSSQL] Description = MS SQL connection to PRODUCTION database Driver = FreeTDS Database = PRODUCTION Server = TPSACC UserName = sa Password = pass Trace = No TDS_Version = 8.0 Port = 54488 odbcinst.ini : [FreeTDS] Description […]
我最近发布了一个设置邮件服务器postfix和虚拟别名的问题。 我在这里解决了这个问题: Postfix / Dovecot – 多个域和多个Linux帐户 总结一下,我把myorigin设置为localhost,还有一些设置。 通过SMTP发送和接收邮件效果很好! 但是,当从/usr/sbin/sendmail发送邮件,即PHP的mail()命令时,它以某种方式忽略From:标题,而是抓取myorigin值。 以下是重要的标题: From: Me <[email protected]> Return-path: <root@localhost> Received: from example.org (example.org [104.xxx.xxx.xxx]) by mx.google.com with ESMTPS… Received-SPF: neutral (google.com: 104.xxx.xxx.xxx is neither permitted nor denied by best guess record for domain of root@localhost) client-ip=104.xxx.xxx.xxx; 当我将myorigin更改为example.org所有的东西都可以很好地发送到PHP,但是完全消除了我以任何方式接收和发送邮件的能力。 所以这不是一个真正的解决scheme。 所以我想要做的是告诉/usr/sbin/sendmail不使用myorigin ,而是使用/etc/mailname JUST FOR PHP 。 我想在其他地方保留postfix的电子邮件。 这可能吗? 谢谢。