Raspberry Pi Php+nginx Installation and PHP call C + + program

Source: Internet
Author: User

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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.