Raspberry Pi Installation Php+nginx process:
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
At that time, there is no package, even if the update is not possible, then refer to the following blog updated the image source:
http://www.ixsz.com/?p=710
2. Modify the Site configuration file:
sudo gedit/etc/nginx/sites-available/default
Modify to the following content:
Server
{Listen the; server_name raspiweb.dyndns.org; Root/var/www/; Access_log/var/log/nginx/Localhost.access.log; #error_page404/404. html; if(!-e $request _filename) {Rewrite^ (. *) $/index.php$1Last ; } Location/{index index.html index.htm index.phpdefault. htmldefault. htmdefault. 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/etc/nginx/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;
PHP calls the C + + Demo:
Http://www.cnblogs.com/freeweb/p/5645699.html
Note that PHP calls the C + + demo in the test executable file, HTML files, PHP files need to be placed in the above root specified path, that is, /var/www/;
And can not directly open the HTML file, you need to enter localhost/form.html in the browser.
Raspberry Pi Php+nginx Installation and PHP call C + + program