0

I am running OS X 10.12.6 on a Mac mini as a server that includes a WordPress site in addition to several web apps that utilize PHP, but version 5.6 is the one installed. I have been doing development on my laptop where I used home-brew to install php 7.3. My web apps run correctly on my laptop. The do not run correctly on the Mac mini. The WordPress application also tells me I should upgrade to PHP 7.3. I did use brew to install php 7.3 and from the command line php -v shows 7.3. Referencing phpinfo.php from the browser shows it is running php 5.6. I've reviewed all the notes I can find about how the Server app configures apache but cannot find how to upgrade the php version that the Server app can control and run.

I have located the configuration for apache on the server at: /Library/Server/web/config/apache2/httpd_server_app.conf. I tried copying the libphp7.so file from my laptop to the server and replaced the loading of the libphp5.so with libphp7.so. However, this failed as the system could not locate a crypto library referenced in the libphp7.so file. It does show however, that the changes I made in the httpd_server_app.conf were being read when I stopped and restarted the Web Server using the Web Sites panel in the Server app. Funny thing, however, is that my change of the server admin in that file was not reflected in the phpinfo.php display when I reverted to php5.6 and restarted.

What is the procedure I should use to upgrade the php server version on the Mac mini? I need to continue using the Server app but need it to use the same version of php as is available from the command line.

5
  • You should provide a full install. Via Google I found these instructions: coolestguidesontheplanet.com/upgrade-php-on-osx – not2savvy Mar 12 '20 at 18:10
  • Probably duplicate of stackoverflow.com/questions/56515703/… – not2savvy Mar 12 '20 at 18:11
  • This is NOT a duplicate of 56515703. That instructs one to install using home-brew ( which if you read my question, I have done ), and completely bypasses the built-in Server app, which, again as stated above, I NEED. PLEASE carefully read the above. NOTE that it says OS X Server. – user3893133 Mar 12 '20 at 19:37
  • Just found, by trial and error, that the file located at: /Library/Server/web/config/apache2/sites/0000_127.0.0.1_34580_.conf is where the server admin comes from that shows in the phpinfo.php display. Still no cigar on replacing php5 with php7 IN THE apache server on OS X Server – user3893133 Mar 12 '20 at 20:00
  • I'm not a fan of running web servers on macOS - you must install PHP7 properly whether by MacPorts, Homebrew, or manually. Then you have to link the correct libraries. I much prefer to run BSD servers and install what I need when I need it without the extraneous overhead. So, short answer..the StackOverflow answer is correct – Allan Mar 13 '20 at 3:28

You must log in to answer this question.

Browse other questions tagged .