Jump to content

Recommended Posts

Hello,

To migrate a PHP application, I need to install and configure nginx to use PHP 5.x, migrate the app, and then upgrade to PHP 7.x to manage the new version.

What's the right way to handle this?

Can I simply run eg. "apt install php5.6-fpm php7.4-fpm", and edit nginx's configuration file to point to the right FPM at the right step?

Thank you.

Link to comment
https://forums.phpfreaks.com/topic/315402-using-php-fpm-5x-and-then-7x/
Share on other sites

No, I don't. I'm investigating if it's doable. At this point, I have a working server with php7.4-FPM.

The legacy app expects "phpBB 3.0.4: PHP 4.3.3+ (>=4.3.3, >4.4.x, >5.x.x, >6.0-dev (compatible))".

I don't know the difference between the "php" package and the "php-fpm" package, especially since I read I shouldn't install the former since it relies on Apache, and therefore installs it.

It sems rather easy:
https://www.atlantic.net/vps-hosting/host-multiple-websites-with-different-php-versions-on-ubuntu-18-04-vps/

Edited by Shohreh

Wow, it's so old it claims to be compatible with PHP 6.

If you're starting from PHP 5.x then you're probably around 5.3 or 5.4. Going to 5.6 as the next step is good and probably won't be too bad. Going to 7.4 is a significant leap that you may want to split into 7.0 first and then 7.4 after.
Because breaking the upgrade process down into steps like that helps make it manageable - going from 5.x directly to 7.4 could easily be a tough slog that will take a long time without the end in sight.

I assume there's more than just installing the most recent version of phpBB? Which is apparently still in active development?

The joys of migrating… which explains why no one wants to do it and we end up with totally outdated and unsecure old servers.

5.6 should be fine to try migrating.

A couple more questions:

1. Why does the php5.6 package contain no binaries?

~# apt-get download php5.6
~# dpkg -c php5.6_5.6.40-63+0~20220929.69+debian11~1.gbp639d4c_all.deb
drwxr-xr-x root/root         0 2022-09-30 00:13 ./usr/
drwxr-xr-x root/root         0 2022-09-30 00:13 ./usr/share/
drwxr-xr-x root/root         0 2022-09-30 00:13 ./usr/share/bug/
drwxr-xr-x root/root         0 2022-09-30 00:13 ./usr/share/bug/php5.6/
-rw-r--r-- root/root        25 2022-09-30 00:13 ./usr/share/bug/php5.6/control
drwxr-xr-x root/root         0 2022-09-30 00:13 ./usr/share/doc/
drwxr-xr-x root/root         0 2022-09-30 00:13 ./usr/share/doc/php5.6/
-rw-r--r-- root/root       480 2022-09-18 14:52 ./usr/share/doc/php5.6/NEWS.Debian.gz
-rw-r--r-- root/root     82584 2022-09-30 00:13 ./usr/share/doc/php5.6/changelog.Debian.gz
-rw-r--r-- root/root    178252 2022-09-30 00:13 ./usr/share/doc/php5.6/changelog.gz
-rw-r--r-- root/root     21026 2022-09-18 14:52 ./usr/share/doc/php5.6/copyright

2. To install php on nginx… how to prevent it from installing Apache as well? Is installing php-fpm enough to run PHP on nginx?

~# apt-get install --download-only php5.6
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php5.6 libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 libpcre3 php-common php5.6-cli php5.6-common php5.6-json
  php5.6-opcache php5.6-readline ssl-cert
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-php5.6 libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 php5.6 php5.6-cli php5.6-common php5.6-json
  php5.6-opcache php5.6-readline ssl-cert
The following packages will be upgraded:
  libpcre3 php-common
2 upgraded, 17 newly installed, 0 to remove and 32 not upgraded.
Need to get 0 B/6,465 kB of archives.
After this operation, 22.5 MB of additional disk space will be used.

 

4 hours ago, Shohreh said:

1. Why does the php5.6 package contain no binaries?

Which binaries do you expect? The ones for Apache support? The FPM daemon? FastCGI? Just the CLI?

Debian/Ubuntu separate PHP into multiple subpackages. "php5.6" is a metapackage with only a handful of files itself. You typically install the more specific packages in addition/instead.

 

4 hours ago, Shohreh said:

2. To install php on nginx… how to prevent it from installing Apache as well? Is installing php-fpm enough to run PHP on nginx?

nginx and php-fpm are separate. You install and configure both individually.

Apache and mod_php are not separate because that approach has PHP as an Apache module so they're directly related. It's the traditional configuration, and one that's mostly fallen out of favor.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.