Hot answers tagged

33

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 a2dismod php7.2 and a2enmod php7.1 so that I could switch over to PHP 7.1 while keeping 7.2 still installed on the server. Most of my sites work after making the ...


26

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 user was at /etc/nginx/nginx.conf This guided me: https://stackoverflow.com/questions/23443398/nginx-error-connect-to-php5-fpm-sock-failed-13-permission-denied


21

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 of using $realpath_root instead of $document_root is copy-pasted all around the Q/A sites and forums; it is actually hard to avoid finding it.Yet, I've only ...


18

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-alternatives --set php /usr/bin/php7.1


12

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=true autorestart=unexpected stdout_logfile=/var/log/php-fpm/stdout.log stdout_logfile_maxbytes=0 stderr_logfile=/var/log/php-fpm/stderr.log stderr_logfile_maxbytes=...


12

@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 the symlink to the desired PHP version. sudo rm /usr/bin/php sudo ln -s /usr/bin/php7.1 /usr/bin/php


11

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 script will die and print z!ax in the web page output. If this happens, then the prober will come back later (maybe seconds later) to exploit the vulnerability for ...


11

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 trouble or sees issues then let me know and I'll update this post. Firstly, as of this writing, Ubuntu's apache2 packages insist on prefork if you want to ...


10

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 party software (nghttp2 and a recent version of openssl) The default repos from Centos are based on Red Hat which prioritises stability rather than latest ...


8

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 cycle as the OS: up to ten years. To maintain that compatibility, the major versions of these tools are fixed at the time of the "dot-zero" release of your ...


8

Alright, found the answer: sudo php-fpm7.0 -t This is somewhat confusing, as the service is named php7.0-fpm.


8

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 the remi-php72 repo, you must also enable the remi and epel repos, but one or both of these are disabled on your system. Enable the remi and epel repos and try ...


6

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 init scripts: /lib/lsb/init-functions.d/40-systemd 1. Edit your php-fpm pool configuration e.g. /etc/php/7.0/fpm/pool.d/www.conf and configure root as the user/...


5

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 installation :)


5

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 their values from "nobody" to "nginx": listen.owner = nginx listen.group = nginx listen.mode = 0660 Lastly, find the lines that set the user and group and ...


5

--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 and not enabled by default so you need to enable it after installation.


5

Here are the steps to troubleshoot this issue: Check if php-fpm is running: sudo service php-fpm status sudo service php7-php-fpm status # use this if you are using remi PHP 7 Check for the listen directive in php-fpm’s www.conf configuration file: grep -Ri listen /etc/php/7.0/fpm/pool.d/www.conf grep -Ri listen /etc/opt/remi/php70/php-fpm.d # for remi ...


5

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.


5

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 when so many frameworks come with .htaccess mod_php configurations in a kind of "plug & play" fashion. At the end, it is the admin the only one responsible to ...


5

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 in php.ini to: extension=sqlite3.so extension=pdo_sqlite.so And restart apache again: sudo systemctl restart apache2


4

Using php7 and any OS packages will be difficult until distros (or third party repos) are updated to handle this and you really shouldn't do this on a production system. My advice is to not attempt this and wait until a PHP7 infrastructure is in place. You could work around by installing most things like PHPMyAdmin by hand, but this is not good system ...


4

You are obviously trying to install a EL-7 package on an EL-6 distro. Remove the remi-release package install the correct version yum clean metadata And PHP 7 is also available for EL-6 in my repo. Reminder: follow the Wizard instructions.


4

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.


4

For the ps option -C to match, you need to make sure you're looking for the right string - not the extended command name shown by default with e.g. -ef, but what the c option shows in combination with e.g. ax. Compare: % ps -ef | grep '[f]'pm www-data 3014 3714 2 19:09 ? 00:01:16 php-fpm: pool www root 3714 1 0 Srp03 ? 00:00:32 ...


4

You have multiple issues here: First, the repo ius is not compatible with remi repositories. Since you are using PHP from remi, you should disable and remove the IUS repo(s) (and find other sources for any other packages you might have from IUS). Second, it looks like your system somehow got connected to an out of date mirror. I would clear the yum caches ...


4

The text on the PHP documentation page you linked to is: MySQL 8 When running a PHP version before 7.1.16, or PHP 7.2 before 7.2.4, set MySQL 8 Server's default password plugin to mysql_native_password or else you will see errors similar to The server requested authentication method unknown to the client [caching_sha2_password] even when ...


4

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.


4

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 overprovisioning. However, I suggest not to simply calculate pm.max_children around the available RAM, but around how many workers are actually necessary for ...


4

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 the default configuration, and is not recommended. You should let it run with its own user ID as it was originally set up. Second, the permission of your ...


3

When you load mysqli after mysqlnd, this solves the issue. BUT if you use phpenmod to enable the modules they enable in alphabetical order. mysqli is before mysqlnd in the order. I got around this by renaming the symlinks to mysqli to zmysqli - crude, but it worked.


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