How to build a LAMP environment and enable error messages in ubuntu12.04
Source: Internet
Author: User
In ubuntu12.04, the LAMP environment is set up perfectly and the error prompt is opened. 1. the LAMP environment www.2cto is set up. coma, install apache2sudoapt-getinstallapache2 after installation in the browser open: http: // localhost if Itworks appears, then apache Security... in ubuntu12.04, the method for setting up the LAMP environment and opening error messages is as follows: 1. set up the LAMP environment www.2cto.com a. install apache2sudo apt-get install apache2 and then open it in the browser: http: // localhost if It works appears, apache installation is successful B, install PHP5 (version 5.3.10) sudo apt-get install php5 sudo apt-get install libapache2-mod-php5 sudo/etc/init. d/apache2 restart apache to test whether the installation is successful: www.2cto.com sudo vim/var/www/test. add content in php Enter http: // localhost/test. php in the browser. if the php configuration information is displayed, the php configuration is successful. C. install Mysqlsudo apt-get install mysql-server and set the root password as prompted during installation. D. let apache and php support mysqlsudo apt-get install libapache2-mod-auth-mysql sudo apt-get install php5-mysql sudo/etc/init. d/apache2 restart and then write another test program to test whether mysql is available. php If Connected successfully is printed, the mysql configuration is successful! Now the LAMP environment has been set up. E. tips in/etc/apache2/: 1. apache2.conf is the main configuration file, httpd. conf user configuration file 2. the virtual directory is in httpd. in the conf file, DocumentRoot "path" ServerName # Listen 127.0.0.1: 80 # note that you cannot write a listener in this file. if you must write a listener, you need to first include/etc/apache2/ports under apache2.conf. conf to comment out, because ports. port 80 has been monitored in conf. 3. the directory is set in/etc/apache2/sites-enabled/000-default. you can set the VM 4 and php. ini:/etc/php5/apache2/php. ini5, mysql. cnf:/etc/mysql/my. cnf 4. restart apache:/etc/init. d/apache2 restar T 5. restart mysql: sudo/etc/init. d/mysql restart or restart mysql 6. log File:/var/log/apache2/7. modify the mysql password mysql-uroot-p123456 and log on to the terminal mysqlmysql> use mysql; MYSQL mysql> update user set password = PASSWORD ('New password') WHERE user = 'root '; mysql> exit to restart mysql to 8, GD Library installation sudo apt-get install php5-gd sudo/etc/init. d/apache2 restart9, curl extension installation sudo apt-get install php5-curl sudo/etc/init. d/apache2 restart 2. enable the default error message When a php file is written, if an error occurs during the call, no error information is displayed, which is blank. This is quite tangled and can be solved through the following methods: 1. open php. ini file sudo chmod 777/etc/php5/apache2/php. ini2, enable error display, and change Off value to On. For example:; display_errors; Default Value: On; Development Value: On; Production Value: Offdisplay_errors = On (if not, add it) 3. search for and modify the downlink, for example:; display_startup_errors; default Value: Off; Development Value: On; Production Value: Offerror_reporting = E_ALL | E_STRICT (if not, add it) 4. modify httpd of Apache. conf is a blank file. you also need to modify sudo chmod 777/etc/apache2/httpd. add the following two lines to the conf file: php_flag display_errors on php_value error_reporting 20395. Restart Apachesudo/etc/init. d/apache2 restart. the error message is enabled, so that you can debug the php file normally ~
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.