48 votes
Accepted

Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, Apache

Below is a description of what I did. I hope this information can help someone else: I installed PHP 7.1 along side PHP 7.2. I also installed most of the needed extensions for PHP 7.1. I then did ...
Pegues's user avatar
  • 901
43 votes
Accepted

Permission Denied for fastcgi_pass using PHP7

I got it working. The php user was www-data but the nginx user was nginx. Check php here: /etc/php/7.0/fpm/pool.d/www.conf listen.owner = www-data listen.group = www-data listen.mode = 0660 Nginx ...
julio's user avatar
  • 954
31 votes

Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, Apache

for display enabled php version in terminal by php -v. we need to set update cli version of php. use below command to update php cli version // change terminal (cli) version (7.2 to 7.1) sudo update-...
Chirag Goti's user avatar
30 votes
Accepted

Nginx caching symlinks

Embedded Variables, $realpath_root: an absolute pathname corresponding to the root or alias directive’s value for the current request, with all symbolic links resolved to real paths The solution ...
Esa Jokinen's user avatar
  • 49.8k
20 votes
Accepted

switch apache from prefork to event in Ubuntu 16, get php 7 working

ezra-s suggests a good approach but it doesn't include some details that might be confusing for folks who rely on package managers. NOTE: I'm not sure if these steps are exact. If anyone encounters ...
S. Imp's user avatar
  • 585
18 votes

How do I start php7.0-fpm with supervisord?

Creating the /var/run/php in the build i.e. mkdir -p /var/run/phpand then starting php-fpm in supervisord [supervisord] nodaemon=true [program:php-fpm] command=/usr/sbin/php-fpm7.0 -F autostart=...
Jonathan's user avatar
  • 287
18 votes

11: Resource temporarily unavailable, while connecting to upstream + Bad Gateway (Nginx)

These errors could be caused by lack of allowed maximum number of socket connections (mostly default is 128). You can view the current limit by executing cat /proc/sys/net/core/somaxconn and it's ...
Alexander Faustov's user avatar
15 votes
Accepted

understand correctly pm.max_children tuning

Your calculation is correct from what I gather. Having many webs on the same server works only as long as not all webs use all available resources at the same time. This is what people usually call ...
Oliver's user avatar
  • 6,028
14 votes

Switch from PHP 7.2 to 7.1 on Ubuntu 16.04, Apache

@pegues: Your above mentioned method worked well for apache to switch the different version. By running following commands will change the php from terminal as well. Actually you just need to change ...
khichar.anil's user avatar
13 votes

nginx php-fpm child exited with code 0

First, this is the expected behavior. The messages are marked as NOTICE, the default in php-fpm.conf: ; Log level ; Possible Values: alert, error, warning, notice, debug ; Default Value: notice ;...
Paulo Coghi's user avatar
12 votes

Start PHP-FPM with root option automatically

On systemd systems, you may have to configure this via systemd rather than system V init scripts The below steps are tested and working on Ubuntu 16.04 LTS. And this is your culprit for redirected ...
Ryan Babchishin's user avatar
12 votes

How to test php-fpm configuration (PHP7.0)

To test the configuration file of PHP FPM (PHP 7.0), run: sudo php-fpm7.0 -t Note that the command name could be somewhat confusing, since the systemd service is named php7.0-fpm. If everything is OK, ...
BurninLeo's user avatar
  • 910
12 votes
Accepted

Apache 2.4 log PHP command 200 success, but what is it doing? POST /?q=die('z!a'.'x'); etc

This is a blind probe for PHP web application vulnerabilities. If you have a PHP web application which somehow executes code from untrusted input, from any of the query parameters given, then the ...
Michael Hampton's user avatar
11 votes

HTTP/2 on CentOS 7 on Apache with PHP7

You need Apache 2.4.18 or higher to enable HTTP/2, though some recommend a minimum of Apache 2.4.23 as lots of changes in mod_http2 since then (discussed further below). This also requires some 3rd ...
Barry Pollard's user avatar
10 votes
Accepted

PHP 7.2 yum installation on Centos 7 misses libargon2.so

The package you are missing is named libargon2, and it is in the epel repository. It was previously in remi until it was added to epel, at which point remi removed it from his repo. In order to use ...
Michael Hampton's user avatar
9 votes

switch apache from prefork to event in Ubuntu 16, get php 7 working

Distros offer the "mod_php" method for convenience. While the most performant way is apache w/event + mod_proxy_fcgi -> php-fpm. Perhaps they should upgrade with the times but its hard for them ...
Daniel Ferradal's user avatar
8 votes

Permission Denied for fastcgi_pass using PHP7

I have fixed same issue by taking following steps. Open your www.conf files (Example : sudo nano /etc/php-fpm.d/www.conf) Lastly, find the lines that set the listen.owner and listen.group and change ...
Nanhe Kumar's user avatar
8 votes

grant PHP permission to allocate executable memory

Recent versions of PHP, systemd, and selinux impose limits and security blocks on access or dynamic allocation of system resources by things like PHP (and php-fpm). For production purposes, the most ...
Brian P's user avatar
  • 906
7 votes

Error with PECL command in PHP7

You need to install those extensions sudo apt-get install php-pear sudo apt-get install php-xml php7.0-xml sudo pecl install mongodb
Toir's user avatar
  • 111
7 votes

How to forcibly completely clear PHP7 opcache?

You have to use opcache_reset(), http://php.net/manual/en/function.opcache-reset.php Note that it doesn't work over CLI; you have to create an HTTP-accessed script that calls it.
Saeven's user avatar
  • 213
7 votes
Accepted

PHP 7 and Centos/Redhat

You select an enterprise distribution for its long term stability. The tools included in your enterprise Linux distribution such as Python, gcc, PHP, Ruby, Perl, Java etc. get the same support life ...
HBruijn's user avatar
  • 80.3k
7 votes

Enabling sqlite3 in php7

Make sure the correct package is installed and apache restarted after: sudo apt install php7.0-sqlite3 sudo systemctl restart apache2 If that didn't work: Then, correct the name for the extension ...
Leo Gallego's user avatar
  • 1,933
7 votes
Accepted

Docker - PHP 7.2 FPM Alpine - Imagick

The files you are missing are in the imagemagick package, which you also need to apk add explicitly. The dependencies for imagemagick-dev do not pull it in.
Michael Hampton's user avatar
7 votes

MediaWiki Issue - PHP Notice: Trying to access array offset on value of type null in .../SectionProfiler.php

I had the same problem when updating XAMPP from PHP 7.2.2 to PHP 7.4.1, while keeping MediaWiki at version 1.30.0. A comparison of the file includes/profiler/SectionProfiler.php with the one in the ...
user558289's user avatar
6 votes
Accepted

How do I start php7.0-fpm with supervisord?

I see there is no /run/php/php7.0-fpm.pid file. This file is created when php7.0-fpm starts. So I solved this issue by adding to Dockerfile: RUN service php7.0-fpm start Of course after php-fpm ...
limestreet's user avatar
6 votes
Accepted

Compiling PHP7 with MySQL error

--with-mysql option is no longer supported in PHP7. You need to use mysqli extension for this. I have not tested this but mysqli extension will be installed by default when you execute ./configure ...
serverliving.com's user avatar
6 votes

Enable error logging on PHP-FPM 7 with Nginx?

The comment above by the_nuts helped solve it for me. The directory and file didn't exist. To diagnose, I added: print("\n\n<br><br>log_errors: ".ini_get('log_errors')); print("\n\n<...
BrianHenryIE's user avatar
6 votes
Accepted

nginx php-fpm child exited with code 0

it is php-fpm bug when using exec functions inside a code. good practice is to block them so the won't make such problem. https://bugs.php.net/bug.php?id=73342 bug is open for last 4 years.
busy's user avatar
  • 291
6 votes

How to downgrade PHP from 7.2 to 7.0

You have php installed from remi-php72, and you want php from remi-php70 Try: yum-config-manager --enable remi-php70 yum-config-manager --disable remi-php72 Then downgrade everything and upgrade ...
Remi Collet's user avatar
  • 2,146
6 votes
Accepted

PHP move_uploaded_file fail

You've got multiple issues here, probably some of which you introduced yourself while trying to solve the original problem. First, your PHP process seems to be running as the nginx user. This was not ...
Michael Hampton's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible