Apache not seeing updated PHP version

Updated PHP using port. The new version is displayed correctly when I ask for

php --version. But when I look at the PHP info on the local server, apache still seems to still see the old packed PHP version. How can I make apache use the updated PHP version? Thanks.


I am trying to use phpMyAdmin on a local web server to experiment with Wordpress, but the phpMyAdmin needs the updated PHP version.


Some more detail:

MacBook Pro, MacOS 13 High Sierra (this old MacBook cannot be updated beyond MacOS 13).


Output of php --version

PHP 7.2.34 (cli) (built: Jan 11 2024 03:20:43) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies


The output from the phpinfo() shows in the section on Apache2 Handler:

Apache/2.4.33 (Unix) PHP/7.1.33


When trying to open phpMyAdmin, I get the following error:

PHP 7.2.5+ is required.

Currently installed version is: 7.1.33



Posted on Sep 24, 2024 2:26 AM

Reply
Question marked as Top-ranking reply

Posted on Sep 24, 2024 4:03 AM

After trying for hours and finally consulting this forum, I did the following, which finally made the Apache web server see the updated PHP version:


port install php72-apache2handler


port contents php72-apache2handler

-->

Port php72-apache2handler @7.2.34_3 contains:

/opt/local/etc/apache2/extra/mod_php72.conf

/opt/local/lib/apache2/modules/mod_php72.so


replacing the mod_php72.so module in the apache httpd.conf (line 177)

#LoadModule php7_module libexec/apache2/libphp7.so

LoadModule php7_module /opt/local/lib/apache2/modules/mod_php72.so


After restarting the apache web server, phpinfo() is now showing

Apache/2.4.33 (Unix) PHP/7.2.34



Hurray!



Similar questions

2 replies
Question marked as Top-ranking reply

Sep 24, 2024 4:03 AM in response to Tarole

After trying for hours and finally consulting this forum, I did the following, which finally made the Apache web server see the updated PHP version:


port install php72-apache2handler


port contents php72-apache2handler

-->

Port php72-apache2handler @7.2.34_3 contains:

/opt/local/etc/apache2/extra/mod_php72.conf

/opt/local/lib/apache2/modules/mod_php72.so


replacing the mod_php72.so module in the apache httpd.conf (line 177)

#LoadModule php7_module libexec/apache2/libphp7.so

LoadModule php7_module /opt/local/lib/apache2/modules/mod_php72.so


After restarting the apache web server, phpinfo() is now showing

Apache/2.4.33 (Unix) PHP/7.2.34



Hurray!



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Apache not seeing updated PHP version

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.