How to use Apache-PHP-Mysql on Mac OSX
Posted: Mon Jun 20, 2011 2:15 pm
Apache
With the Mac OSX installation Apache is installed to your system. You don't need to install it again. What you have to do it is configure and start the process.
Have look at the configuration file. First need to be the super user to edit the file
You can see the default Apache2 configuration there. Then start the server.
Then open a browser and type http://localhost, then you can see the default page of apache.
PHP
PHP is also installed with the Apache2. Only you need to enable module.
Uncomment the following line
Restart the Apache2 to take this effect.
Create test page to test the PHP. Create a file test.php in the document root of the apache /Library/WebServer/Documents/
Test the page http://localhost/test.php
You can place your php.ini by copying from the default php.ini.default
MYSQL
You need to download .dmg of the Mysql Community server form the http://dev.mysql.com/downloads/mysql/ and install it
With the Mac OSX installation Apache is installed to your system. You don't need to install it again. What you have to do it is configure and start the process.
Have look at the configuration file. First need to be the super user to edit the file
Code: Select all
$ sudo su
password:[give your login password]
# vim /etc/apache2/httpd.conf
Code: Select all
# /usr/sbin/apachectl start
PHP
PHP is also installed with the Apache2. Only you need to enable module.
Code: Select all
# vim /etc/apache2/httpd.conf
Code: Select all
#LoadModule php5_module libexec/apache2/libphp5.so
Code: Select all
# /usr/sbin/apachectl restart
Code: Select all
<?php
phpinfo();
?>
You can place your php.ini by copying from the default php.ini.default
Code: Select all
# cp /private/etc/php.ini.default /etc/apache2/
MYSQL
You need to download .dmg of the Mysql Community server form the http://dev.mysql.com/downloads/mysql/ and install it