PHP 7.4
Development | GitHub | Ux Ui | DataBase | Symfony | JavaScript | AJAX | CLI |
Workstation | CentOS 7 | CentOS 8 | PHP 7.4 | Deploy | Work | Testing |
The current version of PHP that we are using is 7.4.
CentOS 7 & PHP 7.4
YUM
Assuming EPEL and REMI are installed
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm sudo yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
Make sure your system has
sudo yum -y install yum-utils sudo yum-config-manager --enable remi-php74
Make sure your system is current
sudo yum update
Issues
During the yum update I got this error:
Transaction check error: file /usr/lib64/libMagickCore-6.Q16.so.6.0.0 from install of ImageMagick-6.9.10.68-3.el7.x86_64 conflicts with file from package ImageMagick6-libs-0:6.9.11.6-1.el7.remi.x86_64 file /usr/lib64/libMagickWand-6.Q16.so.6.0.0 from install of ImageMagick-6.9.10.68-3.el7.x86_64 conflicts with file from package ImageMagick6-libs-0:6.9.11.6-1.el7.remi.x86_64
This is not uncommon, specially if it has bee a while since you did a full upgrade.
We remove the offending RPM and reinstall it later.
sudo yum remove ImageMagick
In this case this also removed caja-image-converter & emacs. Removing emacs is a little bit major, and if you have more than a couple of other files that want to be removed, do a google search to see what others have discovered. Now back to...
sudo yum update
Interesting to note
During my upgrade this is what was going to happen.
Transaction Summary ============================================== Install 4 Packages (+14 Dependent packages) Upgrade 616 Packages Remove 2 Packages Total size: 1.1 G
Quite a reasonable upgrade, it has been a few months since I did a full upgrade. You do want to stay up to date, for bug fixes and security patches.
You will notice that 4 new packages are being installed and 2 removed. This is the nature of the opensource community. Someone may have written a package that helps you rotate pictures from the Command Line, as this has been worked on, many people from different professional and different countries have worked on this free. A new way may have been found to do this job better, and the time may have come, instead of updating a package, a better and more versatile package has been written, hence an old one is deleted and a new one installed.
Once the upgrade is done, I do it again, just in case, there were any dependant upgrades that could be done the first time. This actually happened for me as the first time I ran
sudo yum update
I only had 14 MB of upgrades, the second time 1.1 GB
Also I reinstalled the packages I previous deleted.
sudo yum install ImageMagick caja-image-converter emacs
I now have a successful and full upgrade, on to the rest.
YUM Continued
sudo yum install php php-cli sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json
php -v PHP 7.4.11 (cli) (built: Sep 29 2020 10:17:06) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies
DONE!
Symfony
In your Symfony development area run the command for the console. For Symfony 4.2, something like
php -S 127.0.0.1:8000 -t public
It should return
[Tue Oct 6 08:56:55 2020] PHP 7.4.11 Development Server (http://127.0.0.1:8000) started
OR for Symfony 4.4 or 5.1
symfony server:start
This returned
Version 4.19.0 is available (currently running v4.16.3). Do you want to update now (execution will continue after whatever you decide) ? [Y/n]:
I said Y and once completed did a restart
symfony server:start [WARNING] run "symfony server:ca:install" first if you want to run the web server with TLS support, or use "--no-tls" to avoid this warning Tailing Web Server log file (/home/strider/.symfony/log/6e40ac8f16647bcad4e83a6d35cbab576fc904cc.log) Tailing PHP-FPM log file (/home/strider/.symfony/log/6e40ac8f16647bcad4e83a6d35cbab576fc904cc/53fb8ec204547646acb3461995e4da5a54cc7575.log) [OK] Web server listening The Web server is using PHP FPM 7.4.11 http://127.0.0.1:8000 [Web Server ] Oct 6 08:59:13 |INFO | PHP listening path="/usr/sbin/php-fpm" php="7.4.11" port=35596 [PHP-FPM ] Oct 6 08:59:13 |NOTICE | FPM fpm is running, pid 15822 [PHP-FPM ] Oct 6 08:59:13 |NOTICE | FPM ready to handle connections [PHP-FPM ] Oct 6 08:59:13 |NOTICE | FPM systemd monitor interval set to 10000ms
What did all this mean?
- In development I do not what to run with encryption.
- We are running PHP 7.4.11, good.
- The web server is listening on power http://127.0.0.1:8000
- php-fpm is running on port 35596, The “FPM” part in PHP stands for “Fast Process Manager”, which is just a fancy way of saying that the PHP running on a server isn't a single process, but rather some PHP processes that are spawned, controller, and killed off by this FPM process manager. https://geekflare.com/php-fpm-optimization/