Category: Web Server


If you want to have different setup for php on the command line: add a file called php-cli.ini This will be used by php from the command line, if it is not present it will use php.ini.

If you are getting

mysql_connect() http://function.mysql-connect2002 No such file or directory (trying to connect via unix:///tmp/mysql.sock)"

Then you probably need to modify the “mysql.default_socket” value in your /etc/php.

With Mac XAMPP I set it to:

mysql.default_socket = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock

in /Applications/XAMPP/xamppfiles/etc/php.ini.

This might be a good time to check the correct php is going to run from the command line, by default it will run the Apple supplied php not the XAMPP one. So I put:

 /Applications/XAMPP/xamppfiles/bin

at the top of the /etc/paths file

If you want lots of urls to be redirected to www.abc.com, do this:

<VirtualHost *:80>
ServerName abc.com
ServerAlias *.abc.com
ServerAlias abc.net *.abc.net
and so on...
Redirect permanent / http://www.abc.com
</VirtualHost>
LoadFile /usr/lib/libxml2.dylib
LoadModule proxy_html_module modules/mod_proxy_html.so

I forgot to load the libxml2 file first, so put this in httpd.cont:

LoadFile /usr/lib/libxml2.dylib

LoadModule proxy_html_module modules/mod_proxy_html.so

Which is like this if you used MacPorts to install Apache:

 LoadFile /opt/local/lib/libxml2.dylib

 LoadModule proxy_html_module  modules/mod_proxy_html.so

...also add this line to the bottom of /opt/local/apache2/httpd.conf

 <IfModule proxy_html>

   Include conf/extra/proxy_html.conf

 </IfModule>
Follow

Get every new post delivered to your Inbox.