Install PHP Development Envirement on Ubuntu

Install PHP Development Envirement on Ubuntu

1. Install softwares
Install Apache2
I have installed this software on my system. My version is as follow:
>apache2 -v
Server version: Apache/2.2.17 (Ubuntu)

Install the PHP
>sudo apt-get install php5

Install Mysql
I have done that before. I am a java developer, so I have this database on my system already.

Install PHP command feature
>sudo apt-get install php5-cli

Install other modules
>sudo apt-get install libapache2-mod-php5
>sudo apt-get install libapache2-mod-auth-mysql
>sudo apt-get install php5-mysql
>sudo apt-get install php5-gd

libapache2-mod-php5 and libapache2-mod-auth-mysql are for apache to locate php engine.
php5-mysql is the driver or something for php accessing the mysql database.

2. Change configurations
Apache Configurations
Find lines in /etc/apache2.conf
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

add 2 lines bellow
Include /etc/apache2/mods-available/php5.load
Include /etc/apache2/mods-available/php5.conf

But this is not good way. I don't want to do it like this. So try another way:
sudo ln -s /etc/apache2/mods-available/php5.load /etc/apache2/mods-enabled/php5.load
sudo ln -s /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php5.conf

Link the php work directory to /var/www
>sudo ln -s /home/luohua/work/easyphp /var/www/easyphp

3. Test the envirement
Create a php file named index.php
<?php
phpinfo();
?>

Test this URL: http://localhost:81/easyphp

references:
http://hi.baidu.com/luohuazju/blog/item/c94690e9760b4331b80e2d0b.html
http://hi.baidu.com/luohuazju/blog/item/28d7110a6476d830b0351d77.html
http://hi.baidu.com/luohuazju/blog/item/879852fd879f144bd7887d65.html

http://blog.chinaunix.net/space.php?uid=20665441&do=blog&cuid=2511702
http://www.ylmf.net/ubuntu/tips/2010120913785.html

你可能感兴趣的:(apache,PHP,mysql,ubuntu,Blog)