After upgrading OSX to version 10.9
Apache
check to see if apache is running; go to http://localhost. If not;
sudo apachectl start
check to see if you can access your development sites (probably not :) ); go to oneofyourdevdomains.local.
You probably need to restore the Apache configuration. You’ll need to fix these things;
- re-enable the loading of any modules you need
- re-enable the include of vhost.conf and ssl.conf
- restore the <Directory …> statement so your development directory will work again
restart apache with
sudo apachectl restart
PHP
PHP will work without problems, but – if you use need specific settings for PHP, you need to set those again. Please remember; PHP in 10.8 Mountain Lion is 5.3, 10.9 Mavericks uses PHP 5.4 and 10.10 Yosemite uses PHP 5.5!
sudo cp -a /etc/php.ini.default /etc/php.ini
sudo sh -c "cat >> /etc/php.ini <<'EOF'
;;
;; User customizations below
;;
; Original -- memory_limit = 128M
memory_limit = 196M
; Original -- post_max_size = 8M
post_max_size = 200M
; Original -- upload_max_filesize = 2M
upload_max_filesize = 100M
; Original -- default_socket_timeout = 60
default_socket_timeout = 600
; Original -- max_execution_time = 30
max_execution_time = 300
; Original -- max_input_time = 60
max_input_time = 600
; Original -- display_errors = Off
display_errors = on
; Original -- display_startup_errors = Off
display_startup_errors = on
; Original -- ;date.timezone =
date.timezone = 'Europe/Amsterdam'
EOF"
sudo /usr/bin/php /usr/lib/php/install-pear-nozlib.phar
sudo pear channel-update pear.php.net
sudo pecl channel-update pecl.php.net
sudo pear upgrade --force pear
sudo pear upgrade
sudo pecl upgrade
sudo sh -c "cat >> /etc/php.ini <<'EOF'
; Original -- ;include_path = ".:/php/includes"
include_path = ".:/usr/lib/php/pear"
EOF"
MySQL
I noticed that MySQL (MariaDB in our case) is running after upgrade and the very handy tool SequelPRO is able to connect, but PHP is not. The problem is the socket-file location. The installer of MariaDB would alter the php.ini file to set the – incorrect – location and a simple line of code would change that. So this leaves you with two options;
- Reinstall MariaDB, then reconfigure the mysql.socket paths in php.ini
- Place the socket where php expects it to be by default
The first option, you can figure that out by re-reading this post. The second option is quite simple;
cd /var && sudo mkdir mysql && cd mysql && sudo ln -s /tmp/mysql.sock mysql.sock
PEAR/PECL/other
You need to re-install all PECL/PEAR/other modules for php. As an example; memcache.
sudo pecl uninstall memcache
Now check if the PHP headers are available;
cd /usr/include
ls -a
If php is listed and is a symlink to the 10.8 SDK, remove it
sudo rm php
Now link the 10.9 headers;
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/php php
and also do the same for lzib.h.
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/zlib.h zlib.h
I’m investigating an easier and more permanent way to get these links, but for now this will have to do.
Now you can install memcache again.
sudo pecl install memcache
You can re-compile the mcrypt extension by following the original post on installing mcrypt.
Are you using xdebug?
sudo pecl install xdebug
should install without any problem.
My series of posts also handles other additionals like subversion. I no longer use this library (svn.so) but I did check and found that the required header files are no longer included in Xcode, so I guess that there is no easy way to get it back up and running. When I find a solution, I’ll post it here :)
[August 2014: updated for OSX 10.10 Yosemite]
[March 2014: updated for mcrypt fix]
Thanks man! It saved my time.
Quite happy to be of service :)
Many thanks for sharing!
Poking around, I found that the upgrade left me a copy of the previous php.ini in /etc/php.ini-5.2-previous.
As, ahem, I didn’t have a copy, this was handy for me..
as it read 5.2-previous i thought it to be from the upgrade to Mountain Lion, so i didn’t check. thanks for the hint :)
Thanks for the hints!
After upgrading my Mac mini Server to Maverics my MySQL would not start up again. But in my case it was only a wrong directory name in var/mysql
… if someone run in the same mistake like me – check the mySQL prefPane
;)