Articles of php7

服务器达到MaxRequestWorkers设置

新的8 GB专用服务器在高峰时间和Apache error.log中停止工作,发现以下错误: [mpm_prefork:error] [pid 7565] AH00161: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting [mpm_prefork:notice] [pid 7565] AH00169: caught SIGTERM, shutting down 该网站运行在PHP 7.1.2,Apache / 2.4.10(Debian),根据本教程安装的FPM / FastCGI 经过一番研究之后,我修改了/etc/apache2/mods-available/mpm_prefork.conf ,但仍然在服务器高峰期间出现故障并保持相同的错误。 mpm_prefork.conf的最后更新是: <IfModule mpm_prefork_module> StartServers 20 MinSpareServers 5 MaxSpareServers 10 MaxRequestWorkers 1024 ServerLimit 1024 MaxConnectionsPerChild 0 </IfModule> 这个问题让我担心的是,无论mpm_prefork.conf有什么值,大约6GB的Ram总是空闲的。 我假设一些文件覆盖/etc/apache2/mods-available/mpm_prefork.conf和服务器忽略这个文件,如果没有,那么我肯定写了不适当的设置。 您能否介绍一下如何configurationmpm_prefork.conf文件或者哪些文件可以覆盖这个文件?

PHP 7.1 / Apache 2.4 / Windows – Openssl加载错误

我想升级我的本地服务器到PHP 7.1。 当我试图做到这一切的时候,除了openssl之外,一切都会好的。 随着PHP <= 5.30 openssl工作完美,但如果我切换到PHP 7.1 openssl被禁用。 我认为每个设置都可以(http.conf,php.ini),因为相同的设置适用于其他的PHP版本。 用PHP 7.1我得到这样的味精: 无法find包装“HTTPS” – 你忘了启用它时,你configurationPHP 我试图复制libeay32.dll,ssleay32.dll,openssl.exe在windows文件夹和apache / bin文件夹我试图添加php dir到windowspath我试过每种可能的方式,我已阅读各种页面,但没有任何改变。 有人能帮我吗?

使用Nginx启用PHP-FPM 7上的错误日志logging?

这与这些问题基本相同: https://stackoverflow.com/questions/8677493/php-fpm-doesnt-write-to-error-log Nginx没有loggingPHP错误 但是 ,那里的答案似乎没有与PHP 7的Ubuntu 16.04工作。 /etc/php/7.0/fpm/pool.d/www.conf : catch_workers_output = yes php_flag[display_errors] = on php_admin_value[error_log] = /var/log/fpm-php.www.log php_admin_flag[log_errors] = on /var/log/fpm-php.www.log存在并由www-data拥有。 /etc/php/7.0/fpm/php.ini : log_errors = On Nginx虚拟主机的服务器块 access_log /var/log/myapp/access.log; error_log /var/log/myapp/error.log error; /var/log/myapp/access.log存在并由www-data拥有。 但是,当发生错误时,我不会在任何指定的日志文件中出现错误,也无法在其他任何地方find它。 我经历了关于另一个问题的所有build议,但没有find任何有效的答案。 自从这些答案发布以来,我假定有些事情已经改变了。 有什么build议么?

nginx php-fpm子代码退出

任何人有与11.0-RELEASE-P8的PHP-FPM 7类似的问题,或知道如何debugging? 情况在几分钟后开始,只向客户显示半页。 任何页面显示大约〜62kb的内容结尾 4. php-fpm的日志文件: [18-Mar-2017 15:41:49] NOTICE: [pool www] child 80582 exited with code 0 after 0.005648 seconds from start [18-Mar-2017 15:41:49] NOTICE: [pool www] child 80584 started [18-Mar-2017 15:41:49] NOTICE: [pool www] child 80583 exited with code 0 after 0.005877 seconds from start [18-Mar-2017 15:41:49] NOTICE: [pool www] child 80585 started [18-Mar-2017 […]

同时运行phpMyAdmin和php-7?

在将php5升级到php7之后 ,当我想apt-get install phpmyadmin时候出现这个错误 The following packages have unmet dependencies: phpmyadmin : Depends: libapache2-mod-php5 but it is not going to be installed or libapache2-mod-php5filter but it is not going to be installed or php5-cgi but it is not going to be installed or php5-fpm but it is not going to be installed or php5 but […]

在特定的PHP版本上安装MongoDB扩展

我有一个Debiannetworking服务器,我在其上安装了ApacheConfig3的Apache / Mysql / PHP5。我手动安装了额外的PHP版本(PHP 7.0.5),以便在PHP 5上有一个网站,在PHP 7上有一个网站,一切正常。 (我使用下面的教程安装PHP 7: https : //www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/ ) 现在我想安装新的MongoDB驱动程序(PHP 7友好),所以它适用于我的PHP 7网站(我得到了遗留的驱动程序在PHP 5上工作)。 为此,我使用pecl install mongodb并将extension=mongodb.so添加到PHP 7 ini文件中。 安装是好的,但是当我检查PHP 7的扩展状态,它告诉我扩展没有加载。 原因似乎是安装在PHP 5版本的MongoDB驱动程序,而不是PHP 7。 我怎么能告诉MongoDB驱动程序安装在PHP 7版本与PECL(或者也许另一种方式来安装它)?

Nginx 502错误的网关错误

目前在我的Centos 6.8服务器上有一个502错误的网关错误。 2017/01/30 23:57:31 [crit] 26911#0: *1 connect() to unix:/var/run/php/php7.0-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.0.15, server: 192.168.0.$ 我检查了目录是否存在,而不是。 我能find的最近的文件夹是/ var / run / php-fpm,它只包含php-fpm.pid。

PHP-FPM池用户进行负载平衡

我们知道在负载均衡中处理部分与数据库是分开的。 在处理我使用php-fpm。 我必须在php-fpm池中select一个linux用户和组。 如果我使用root作为php-fpm池的用户和组,是否有任何安全问题? 这些服务器仅用于运行我们的网站高stream量。 没有其他用户将主持网站。 ; Start a new pool named 'www'. ; the variable $pool can we used in any directive and will be replaced by the ; pool name ('www' here) [www] user = root group = root listen.owner = root listen.group = root listen.mode = 0660

Nginxcaching符号链接

我的Web服务器上有一个部署系统,每次部署一个应用程序时,它会创build一个新的时间戳目录,并将“当前”符号链接到新目录。 在apache上这一切都很好,但是在我设置的新的nginx服务器上,它看起来像是一个来自“旧”部署的脚本,而不是新的符号链接的脚本。 我已经阅读了一些教程和post,如何解决这个问题,但没有太多的信息,似乎没有任何工作。 这是我的虚拟主机文件: server { listen 80; server_name ~^(www\.)?(?<sname>.+?).testing.domain.com$; root /var/www/$sname/current/public; index index.html index.htm index.php; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~* \.(jpg|jpeg|gif|png|bmp|ico|pdf|flv|swf|exe|html|htm|txt|css|js) { add_header Cache-Control public; add_header Cache-Control must-revalidate; expires 7d; } location ~ \.php$ { #fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; include fastcgi_params; fastcgi_param DOCUMENT_ROOT $realpath_root; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_index index.php; […]

使用root选项自动启动PHP-FPM

我试图让PHP-FPM以root身份运行一个池,但似乎无法调整init.d启动参数。 它从CLI启动PHP-FPM(使用sudo php-fpm7.0 -DRy /etc/php/7.0/fpm/php-fpm.conf ,但是我不能得到这个与service命令( sudo service php7.0-fpm (re)start 。所以每当服务器重新启动,PHP-FPM失败,我将不得不运行此命令。 我已经尝试在/etc/default中将DAEMON_ARGS="–daemonize –fpm-config $CONFFILE -R"放入一个文件“php-fpm7.0 DAEMON_ARGS="–daemonize –fpm-config $CONFFILE -R" ,我甚至尝试将-R参数添加到直接在/etc/init.d/php7.0-fpm do_start函数,但是我一直在得到please specify user and group other than root错误please specify user and group other than root 。 有什么办法,我可以得到这个启动和service命令工作? 离题:我知道所有的风险,我知道为什么我不应该这样做,但是我想要。 我需要运行一些脚本来创build目录,执行chown命令等,池将专用于一个nginx服务器模块使用的后端,该模块只能在一个特定的URLpath上从私有192.168.1.Xnetworking访问。 作为替代,我可以设置一个cron脚本来执行一个PHP脚本作为根,但是这种方法会花费我更多的时间。