Previously, LNMP was successfully installed using javastuserver12.04. Then I installed Ubuntu12.10desktop on my local environment. Install LNMP as per my article. See Region
Previously, LNMP was successfully installed on Ubuntu Server 12. 04. Then I installed Ubuntu 12.10 desktop on my local environment.
Install LNMP as per my article. See http://www.linuxidc.com/Linux/2012-12/75438.htm
However, after the installation is successful, I found that the "welcome to nginx" image can appear normally at http: // localhost. Then I wrote a php probe file, but this reported an error. 502...
Now I am depressed... Why?
First, let's take a look at the previous configuration. Configure the PHP component.
- Location ~ \. Php $ {
- Try_files $ uri = 404;
- Fastcgi_pass 127.0.0.1: 9000;
- Fastcgi_index index. php;
- Include fastcgi_params;
- }
The problem actually occurs in fastcgi_pass configuration.
After the php5-fpm is installed on ubuntu 12.10. We can go
- /Etc/php5/fpm/pool. d/www. conf
Find the following code:
- Listen =/var/run/php5-fpm.sock
This is the use of unix to use php5-fpm.
At this time. We need to change the php configuration
- Location ~ \. Php $ {
- Fastcgi_pass unix:/var/run/php5-fpm.sock;
- Fastcgi_index index. php;
- Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
- Include fastcgi_params;
- }
Here, the address of fastcgi_pass should be changed to this .. In this way, your lnmp will be normal.