0

I installed Apache, PHP, and Mariadb on my macOS Sierra using this guide. Haven't setup SSL yet since I don't need it as of now.

The problem is that I'm unable to update/install plugins on a clean WP install when I use PHP 5.6. It's stuck on Installing or Updating or Updating Package. I've enabled debugging for PHP and WP but see nothing in the WP debug log or my PHP error log.

The error I see in Chrome's console is: admin-ajax.php Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Nothing in Apache's error log as well. Only the access logs have a 500:

127.0.0.1 - - [15/May/2017:14:10:56 +0530] "POST /wptest/wp-admin/admin-ajax.php HTTP/1.1" 200 47 127.0.0.1 - - [15/May/2017:14:10:02 +0530] "POST /wptest/wp-admin/admin-ajax.php HTTP/1.1" 500 - ::1 - - [15/May/2017:14:11:24 +0530] "OPTIONS * HTTP/1.0" 200 - 127.0.0.1 - - [15/May/2017:14:11:45 +0530] "POST /wptest/wp-admin/admin-ajax.php HTTP/1.1" 200 47

Note that this happens only on PHP 5.6 on my setup (sphp 56). I don't face this problem on PHP 7 on the same setup (sphp 70). I haven't tried with 5.5 or 7.0, but will do if it helps in the diagnosis. I also just tried it on MAMP PRO and I don't face the issue there as well on PHP 5.6.

If the root cause is the 500 error and that means an Apache issue, what could be possibly going wrong with Apache only on PHP 5.6 and not 7.0 ?

Could it be that macOS sierra ships with PHP 5.6 at

➜ ~ /usr/bin/php -v
PHP 5.6.30 (cli) (built: Feb 7 2017 16:06:52) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

And that could be conflicting? Though the Apache setup I did using that link does use the custom installed version and not macOS' version:

➜ ~ which php /usr/local/bin/php ➜ ~ php -v PHP 5.6.30 (cli) (built: May 13 2017 13:36:55) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies with Xdebug v2.5.3, Copyright (c) 2002-2017, by Derick Rethans

Any thoughts on this issue would be appreciated. Thanks!

1
  • I don't have an answer to your question, but I would recommend you look at Mamp, which installs Apache, PHP and MySQL as an application within Mac OS, rather than using the built-in tools. It's much easier to manage.
    – Lee
    May 15, 2017 at 9:07

2 Answers 2

1

add this to your wp-config.php file define( 'WP_MEMORY_LIMIT', '256M' );

0

Do you have any plugins or themes installed? Maybe try to deactivate all plugins and switch to a default wordpress theme. Maybe on of those causes the problem with older php versions.

3
  • Forgot to add to the question that I'm using a clean WP install. Edited now.
    – sgro
    May 15, 2017 at 9:43
  • Is there an error.log file in the wptest folder? Most of the time the error.log file contains the specific reason. May 15, 2017 at 10:32
  • WP does not have error.log files unless one has configured php's (or other) log files location to be in that folder. However, as I said in the question: I've enabled debugging for PHP and WP but see nothing in the WP debug log or my PHP error log.
    – sgro
    May 15, 2017 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.