Skip to content

Instantly share code, notes, and snippets.

@dcardosods
Created September 28, 2012 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcardosods/3800024 to your computer and use it in GitHub Desktop.
Save dcardosods/3800024 to your computer and use it in GitHub Desktop.
brew install php Mac 10.5.8
estomac7:~ daniel$ brew install https://raw.github.com/jmlane/homebrew-php/3fe2834af207e091feac466e87643f60a6d61c9d/Formula/php.rb --with-mysql
######################################################################## 100.0%
==> Installing php dependency: cmake
==> Downloading http://www.cmake.org/files/v2.8/cmake-2.8.9.tar.gz
######################################################################## 100.0%
==> ./bootstrap --prefix=/usr/local/Cellar/cmake/2.8.9 --system-libs --no-system-libarchive --datadir=/share/cmake --docdir=/share/doc/cma
==> make
==> make install
Warning: m4 macros were installed to "share/aclocal".
Homebrew does not append "/usr/local/share/aclocal"
to "/usr/share/aclocal/dirlist". If an autoconf script you use
requires these m4 macros, you'll need to add this path manually.
==> Summary
/usr/local/Cellar/cmake/2.8.9: 662 files, 30M, built in 6.9 minutes
==> Installing php dependency: pidof
==> Downloading http://www.nightproductions.net/downloads/pidof_source.tar.gz
######################################################################## 100.0%
==> make all CC=/usr/bin/gcc-4.2 CFLAGS=-Os -w -pipe -march=core2 -msse4.1 -mmacosx-version-min=10.5
==> /usr/bin/gzip pidof.1
/usr/local/Cellar/pidof/0.1.4: 3 files, 24K, built in 2 seconds
==> Installing php dependency: mysql
==> Downloading http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.27.tar.gz/from/http://cdn.mysql.com/
######################################################################## 100.0%
==> cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/mysql/5.5.27 -DMYSQL_DATADIR=/usr/local/var/mysql -DINSTALL_MANDIR=/usr/local/Cellar/
==> make
==> make install
==> Caveats
Set up databases to run AS YOUR USER ACCOUNT with:
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
To set up base tables in another folder, or use a different user to run
mysqld, view the help for mysqld_install_db:
mysql_install_db --help
and view the MySQL documentation:
* http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html
* http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html
To run as, for instance, user "mysql", you may need to `sudo`:
sudo mysql_install_db ...options...
Start mysqld manually with:
mysql.server start
Note: if this fails, you probably forgot to run the first two steps up above
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
To connect:
mysql -uroot
To launch on startup:
* if this is your first install:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mysql/5.5.27/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
* if this is an upgrade and you already have the homebrew.mxcl.mysql.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
cp /usr/local/Cellar/mysql/5.5.27/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
You may also need to edit the plist to use the correct "UserName".
Warning: Non-executables were installed to "bin".
Installing non-executables to "bin" is bad practice.
The offending files are:
/usr/local/Cellar/mysql/5.5.27/bin/mysqlaccess.conf
Warning: m4 macros were installed to "share/aclocal".
Homebrew does not append "/usr/local/share/aclocal"
to "/usr/share/aclocal/dirlist". If an autoconf script you use
requires these m4 macros, you'll need to add this path manually.
==> Summary
/usr/local/Cellar/mysql/5.5.27: 6384 files, 210M, built in 7.8 minutes
==> Installing php
==> Downloading http://www.php.net/get/php-5.3.10.tar.bz2/from/this/mirror
######################################################################## 100.0%
==> Patching
patching file ext/tidy/tidy.c
patching file Makefile.global
==> ./configure --prefix=/usr/local/Cellar/php/5.3.10 --with-config-file-path=/usr/local/etc --with-config-file-scan-dir=/usr/local/etc/ph
==> make
==> make install
==> /usr/local/Cellar/php/5.3.10/bin/pear config-set php_ini /usr/local/etc/php.ini
==> Caveats
For 10.5 and Apache:
Apache needs to run in 32-bit mode. You can either force Apache to start
in 32-bit mode or you can thin the Apache executable.
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/Cellar/php/5.3.10/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/etc/php.ini
Development and head builds will use libedit in place of readline.
If you have installed the formula with --with-fpm, to launch php-fpm on startup:
* If this is your first install:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/php/5.3.10/org.php-fpm.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.php-fpm.plist
* If this is an upgrade and you already have the org.php-fpm.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/org.php-fpm.plist
cp /usr/local/Cellar/php/5.3.10/org.php-fpm.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.php-fpm.plist
You may also need to edit the plist to use the correct "UserName".
==> Summary
/usr/local/Cellar/php/5.3.10: 478 files, 26M, built in 6.2 minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment