operating_systems:apple:apache_-_php_-_mysql
This is an old revision of the document!
Table of Contents
Apache - PHP - MySQL
Apache
Edit the apache2 hosts configuration files (per user)
# cd /etc/apache2/users/ # ls Guest.conf username.conf
# cat username.conf NameVirtualHost *:80 <VirtualHost *:80> ServerName localhost DocumentRoot /Users/username/Sites <Directory "/Users/username/Sites/"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost *:80> ServerName myDomain DocumentRoot /Users/username/Sites/.../myDir <Directory "/Users/sbolay/Sites/.../myDir/"> Options Indexes MultiViews AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
Hosts
Add the hostname to resolve $sudo -e /private/etc/hosts 127.0.0.1 localhost 127.0.0.1 myHost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost
HTTPD.CONF
Uncomment both lines below
$sudo -e /private/etc/apache2/httpd.conf LoadModule userdir_module libexec/apache2/mod_userdir.so # User home directories Include /private/etc/apache2/extra/httpd-userdir.conf
PHP
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20090626/gettext.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20090626/gettext.so, 9): image not found in Unknown on line 0
Install php for mac from http://php-osx.liip.ch
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6
Copy the php.ini file
$sudo cp /private/etc/php.ini.default /private/etc/php.ini
MySQL
Install MySQL from http://dev.mysql.com/downloads/mysql/ (e.g. mysql-5.6.12-osx10.7-x86_64) and start it
$sudo installer -pkg /Volumes/mysql-5.7.9-osx10.9-x86_64/mysql-5.7.9-osx10.9-x86_64.pkg -target /Volumes/Macintosh\ HD $sudo /Library/StartupItems/MySQLCOM/MySQLCOM start $/usr/local/mysql/bin/mysqladmin -u root password NEWPASSWORD export PATH="/usr/local/mysql/bin:$PATH"
Warning: mysqli_connect(): (HY000/2002): No such file or directory in /Users/bfavre/Sites/git/easyaccess-web/lib/lib_dbconnection.php on line 27
Could not connect to server (2002) No such file or directory
ln -s /tmp/mysql.sock /private/var/mysql/
gettext
[Wed Jun 26 19:21:19 2013] [error] [client ::1] PHP Fatal error: Call to undefined function bindtextdomain() in /Users/sbolay/Sites/GIT/easyaccess-web/lib/lib_language.php on line 66
Download gettext from https://www.gnu.org/software/gettext/
wget http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz tar -xzf gettext-0.18.3.1.tar.gz cd gettext-0.18.3.1
./configure make all-am
/bin/sh ../libtool –tag=CC –mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -DEXEEXT=\“\” -DEXEEXT=\“\” -DEXEEXT=\“\” -I. -I.. -I../intl -I../intl -I.. -I.. -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -I../intl -I/usr/include/libxml2 -I./libcroco -g -O2 -c -o stpncpy.lo stpncpy.c
libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -DEXEEXT=\“\” -DEXEEXT=\“\” -DEXEEXT=\“\” -I. -I.. -I../intl -I../intl -I.. -I.. -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -I../intl -I/usr/include/libxml2 -I./libcroco -g -O2 -c stpncpy.c -fno-common -DPIC -o .libs/stpncpy.o
stpncpy.c:34: error: expected declaration specifiers or '…' before numeric constant
stpncpy.c:34: error: expected ')' before '!=' token
stpncpy.c:34: error: expected ')' before '?' token
make[4]: * [stpncpy.lo] Error 1
make[3]: * [all] Error 2
make[2]: * [all-recursive] Error 1
make[1]: * [all] Error 2
make: *** [all-recursive] Error 1
libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -DEXEEXT=\“\” -DEXEEXT=\“\” -DEXEEXT=\“\” -I. -I.. -I../intl -I../intl -I.. -I.. -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1 -I../intl -I/usr/include/libxml2 -I./libcroco -g -O2 -c stpncpy.c -fno-common -DPIC -o .libs/stpncpy.o
stpncpy.c:34: error: expected declaration specifiers or '…' before numeric constant
stpncpy.c:34: error: expected ')' before '!=' token
stpncpy.c:34: error: expected ')' before '?' token
make[4]: * [stpncpy.lo] Error 1
make[3]: * [all] Error 2
make[2]: * [all-recursive] Error 1
make[1]: * [all] Error 2
make: *** [all-recursive] Error 1
Edit stpncpy.c line 34
(__stpncpy) (char *dest, const char *src, size_t n)
and modify it to
(__stpcpy) (char *dest, const char *src, size_t n)
Recompile
make make install
Add in php.ini the support for gettext
$sudo -e /private/etc/php.ini error_reporting = E_ALL extension=intl.so extension=gettext.so
Final
Restart Apache
$sudo apachectl restart
Links
operating_systems/apple/apache_-_php_-_mysql.1448633345.txt.gz · Last modified: 2015/11/27 14:09 by bfavre