Install Apache, MySQL, and PHP on Ubuntu
1: first install Apache: Open the terminal (CTRL + ALT + T ),
Run sudo apt-Get install apache2,
After installation, open your browser and enter localhost or http: // 127.0.0.1 in the address bar.
If you see it works, the installation is successful!
Default root directory:/var/www/
2: Install MYSQL:
Sudo apt-Get install mysql-server-5.0
After installation, you will be asked to set a new MySQL Root Password, enter your own password, enter the key, and then confirm the password.
3: install PHP 5 and Apache PHP 5 module:
Sudo apt-Get install PhP5 libapache2-mod-php5
Sudo/etc/init. d/apache2 restart (restart Apache)
The attempt is successful. No:
Command: gksudo gedit/var/www/text. php [Create a text. php file under the default Apache root directory/var/www]
Enter the following code in the text. php file to check whether the installation is successful:
-
<? PHP
-
Echo "helloworld ";
-
?>
Enter http: // localhost/text. php in the address bar of the browser. If helloworld is displayed on the page, the request is successful.
Tip: if you cannot enter the command again when you return to the terminal, press Ctrl + Z.
4: make Apache and PHP support PHP:
Sudo apt-Get install libapache2-mod-auth-mysql
Sudo apt-Get install php5-mysql
Sudo/etc/init. d/apache2 restart (restart Apache)
Now the environment has been set up!
/Var/www/(put The apache2 webpage file here)
/Var/lib/MySQL (put the MySQL file here)
If you want to connect remotely, you need to install SSH with the command: sudo apt-Get Install SSH
Maybe we are still used to phpMyAdmin.
5. Install phpMyAdmin.
Sudo apt-Get install phpMyAdmin
Enter http: // localhost/phpMyAdmin in the browser to find not found.
Therefore, you must transfer the installation to the phpMyAdmin folder to/var/www /.
Sudo ln-S/usr/share/phpMyAdmin // var/www/
Run the preceding command to transfer the phpMyAdmin folder to the destination. Alternatively, you can copy phpMyAdmin directly to the/var/www/folder.
When we enter http: // localhost/phpMyAdmin in the browser again, we find that the interface we are familiar with is back.
1> Apache configuration file path/etc/apache2/apache2.conf
2> PHP. ini path/etc/PhP5/apache2/php5.ini
3> MySQL configuration file path/etc/MySQL/My. CnF in my. CNF bind-address 127.0.0.1 plus # access from other machines
4> phpMyAdmin configuration file path/etc/PHPmyAdmin/Apache. conf
5> website root directory/var/WWW
6> sudo/etc/init. d/apache2 restart
7> sudo/etc/init. d/MySQL restart
8> In ubuntu, modify the root directory of the Ubuntu Apache website. Under the/etc/apache2/sites-enabled/directory, you can see a 000-default file. restart the apache2 service after the path changes.
6. Install the Input Method
Sudo apt-Get install ibus-pinyin
Ibus-daemon & (a keyboard icon is displayed in the upper-right corner of the command to retrieve the icon ibus-Daemon-drx)
Set up ibus