Getting PHP and Apache to work again after upgrading to Yosemite

One of the worst part about upgrading OSX has to be reconfiguring Apache to work. It was the same when I upgraded to Maverick, and again now in my upgrade to Yosemite.

Apache:

The httpd.conf is still at the same place: /etc/apache2/httpd.conf, but it was overwritten. I think the previous is automatically backed up as httpd.conf~previous.

You can use sudo apachectl configtest to check configuration errors. Diff-ing the previous version against the current version yielded the following (annoying) gotchas:

  1. Many modules were turned off by default (ie. php5_module). Some were added (ie. session_module), renamed (ie. disk_cache_module), or removed (ie. ident_module)
  2. User & Group were reset to _www
  3. Order deny,allow / Deny from all is now Require all denied
  4. Order deny,allow / Allow from all is now Require all granted
  5. Supplemental configs were removed (ie. httpd-vhosts.conf, httpd-ssl.conf, etc)
  6. For SSLSessionCache, you need to enable several modules in the httpd.conf file (ie. socache_shmcb_module, socache_dbm_module, socache_memcache_module)
The biggest, and most annoying gotcha of all were items #3 and #4. Make sure you make these changes in all supplemental configs like httpd-vhosts.conf.

PHP:

php.ini was removed. I think the previous is automatically backed up as php.ini-x.x-previous. For some reason, my php zts extension was updated as well, so I had to make a minor update to the php.ini ie. /usr/lib/php/extensions/no-debug-non-zts-xxxxxxxx/xdebug.so

P.s. I don't remember if I had to reinstall pear.

MySQL:

If MySQL isn't started, run this command to start it again:
sudo /usr/local/mysql/support-files/mysql.server start

No comments: