Set up a PHP development environment in Ubuntu & nbsp; you can choose to install all packages with one click, you can also install them one by one. here I select one-click installation. The steps are as follows: & nbsp; & set up the PHP development environment under Ubuntu
You can choose one-click installation of all packages, or install them one by one. here I choose one-click installation.
The procedure is as follows:
1. sudo apt-get install apache2 mysql-server mysql-client php5 one-click installation
Reading the package list... complete
Analyzing the dependency tree of the software package
Reading status information... complete
Apache2 is the latest version.
The following additional software packages will be installed:
Apache2-mpm-prefork libapache2-mod-php5 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl
Libterm-readkey-perl mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server-5.5 mysql-server-core-5.5 php5-cli php5-common
Recommended software packages:
Php-pear libipc-sharedcache-perl tinyca mailx php5-suhosin.
The following software packages will be [uninstalled ]:
Apache2-mpm-worker
The following [new] software packages will be installed:
Apache2-mpm-prefork libapache2-mod-php5 libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient18 libnet-daemon-perl libplrpc-perl
Libterm-readkey-perl mysql-client mysql-client-5.5 mysql-client-core-5.5 mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5 php5
Php5-cli php5-common php5-gd php5-mysql
0 software packages have been upgraded, 21 new software packages have been installed, and 1 software package has to be uninstalled. 196 software packages have not been upgraded.
Download the 33.0 MB software package.
After decompression, 110 MB of extra space is consumed.
Do you want to continue? [Y/n] y
Click y to continue installation
Get: 1 http://cn.archive.ubuntu.com/ubuntu/ precise/main libnet-daemon-perl all 0.48-1 [43.1 kB]
Get: 2 http://cn.archive.ubuntu.com/ubuntu/ precise/main libplrpc-perl all 0.2020-2 [36.0 kB]
Get: 3 http://cn.archive.ubuntu.com/ubuntu/ precise/main libdbi-perl i386 1.616-1build2 [849 kB]
Get: 4 http://security.ubuntu.com/ubuntu/ precise-security/main apache2-mpm-prefork i386 2.2.22-1ubuntu1. 4 [2,408 B]
Get: 5 http://security.ubuntu.com/ubuntu/ precise-security/main mysql-common all 5.5.35-0ubuntu0. 12.04.1 [13.0 kB]
Get: 6 http://security.ubuntu.com/ubuntu/ precise-security/main libmysqlclient18 i386 5.5.35-0ubuntu0. 12.04.1 [924 kB]
Get: 7 http://cn.archive.ubuntu.com/ubuntu/ precise/main libdbd-mysql-perl i386 4.020-1build2 [104 kB]
Get: 8 http://cn.archive.ubuntu.com/ubuntu/ precise/main libterm-readkey-perl i386 2.30-4build3 [28.4 kB]
Get: 9 http://cn.archive.ubuntu.com/ubuntu/ precise/main libhtml-template-perl all 2.10-1 [65.0 kB]
Get: 10 http://security.ubuntu.com/ubuntu/ precise-security/main mysql-client-core-5.5 i386 5.5.35-0ubuntu0. 12.04.1 [1,860 kB]
9% [10 mysql-client-core-5.5 1,073 kB/1,860 kB 58%] 14.7 kB/s 33 minutes 48 seconds ^ Cf
Now, the environment has been set up. you can test it.
Enter localhost in firefox.
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
2. sudo chmod 777/var/www/Because the website directory of the server is under this file, you must obtain the 777 permission.
3. you can select phpmyadmin or not, such as sudo apt-get install phpmyadmin.
Felayman @ felayman :~ $ Sudo apt-get install phpmyadmin
Reading the package list... complete
Analyzing the dependency tree of the software package
Reading status information... complete
The following additional software packages will be installed:
Apache2-mpm-prefork dbconfig-common libapache2-mod-php5 libdbd-mysql-perl
Libdbi-perl libmcrypt4 libmysqlclient18 libnet-daemon-perl libplrpc-perl
Libterm-readkey-perl mysql-client mysql-client-5.5 mysql-client-core-5.5
Mysql-common php5-cli php5-common php5-gd php5-mcrypt php5-mysql
Recommended software packages:
Php-pear libmcrypt-dev mcrypt php5-suhosin mysql-server
The following software packages will be [uninstalled ]:
Apache2-mpm-worker
The following [new] software packages will be installed:
Apache2-mpm-prefork dbconfig-common libapache2-mod-php5 libdbd-mysql-perl
Libdbi-perl libmcrypt4 libmysqlclient18 libnet-daemon-perl libplrpc-perl
Libterm-readkey-perl mysql-client mysql-client-5.5 mysql-client-core-5.5
Mysql-common php5-cli php5-common php5-gd php5-mcrypt php5-mysql phpmyadmin
0 software packages have been upgraded, 20 new software packages have been installed, and 1 software package has to be uninstalled. 196 software packages have not been upgraded.
Download the 22.3 MB/24.3 MB software package.
After decompression, 77.7 MB of extra space is consumed.
Do you want to continue? [Y/n] y
Click y to continue installation
Get: 1 http://cn.archive.ubuntu.com/ubuntu/ precise/main dbconfig-common all 1.8.47 [458 kB]
Get: 2 http://cn.archive.ubuntu.com/ubuntu/ precise/universe libmcrypt4 i386 2.5.8-3.1 [76.1 kB]
Get: 3 http://cn.archive.ubuntu.com/ubuntu/ precise/universe php5-mcrypt i386 5.3.5-0ubuntu1 [16.9 kB]
Get: 4 http://cn.archive.ubuntu.com/ubuntu/ precise/universe phpmyadmin all. 4.10.1-1 [5,343 kB]
Get: 5 http://security.ubuntu.com/ubuntu/ precise-security/main php5-common i386 5.3.10-1ubuntu3. 10 [163 kB]
Get: 6 http://security.ubuntu.com/ubuntu/ precise-security/main libapache2-mod-php5 i386 5.3.10-1ubuntu3. 10 [3,109 kB]
During the installation process, you must select Web server: apache2 or lighttpd, select apache2, press the tab key, and click OK. Then, you are required to enter the Mysql database Password of the database's administrative user.