A lot of relevant online tutorials, here is not detailed, mainly in the installation after the completion of the page will appear blank, unable to parse the normal PHP.
1. Install PHP Environment:
sudo apt-get install nginx php5-fpm php5-cgi php5-cli php5-curl php5-gd php5-mcrypt php5-mysql php5-memcache php5-gd php5- SQLite php5-cgi php5-xmlrpc mysql-server mysql-client
If you don't need a MySQL environment, remove the last two mysql-server mysql-client
2. Modify the Site configuration file:
sudo nano/etc/nginx/sites-available/default
Modify to the following content:
server { listen; server_name raspiweb.dyndns.org; root/var/www/; Access_log /var/log/nginx/localhost.access.log; #error_page 404/404.html; if (!-e $request _filename) { rewrite ^ (. *) $/index.php$1 last; } Location/{ index index.html index.htm index.php default.html default.htm default.php; } Location ~* ^.+. (Jpg|jpeg|gif|css|png|js|ico|xml) $ { access_log off; Expires 1d; } Location ~. *\.php (\/.*) *$ { fastcgi_split_path_info ^ (. +\.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; }}
It should be stated that the site Directory is/var/www/, focusing on this sentence:
Fastcgi_param script_filename $document _root$fastcgi_script_name;
If it's less, add it.
Raspberry Pi PHP Environment Configuration Resolution page blank