{"id":10979,"date":"2013-02-05T19:45:00","date_gmt":"2013-02-05T18:45:00","guid":{"rendered":"http:\/\/touk.pl\/blog\/?guid=74e3ed874188d80a51d47a19887fc326"},"modified":"2015-08-14T13:48:23","modified_gmt":"2015-08-14T12:48:23","slug":"http-server-with-php-on-raspberrypi","status":"publish","type":"post","link":"https:\/\/touk.pl\/blog\/2013\/02\/05\/http-server-with-php-on-raspberrypi\/","title":{"rendered":"Http server with PHP on RaspberryPI"},"content":{"rendered":"<p>Totally awesome guide is at&nbsp;<a href=\"http:\/\/rasberrypibeginnersguide.tumblr.com\/post\/27283563130\/nginx-php5-on-raspberry-pi-debian-wheezy\">http:\/\/rasberrypibeginnersguide.tumblr.com\/post\/27283563130\/nginx-php5-on-raspberry-pi-debian-wheezy<\/a><br \/>But instead using provided silex site config file, you should configure root folder of web server to serve php scripts. To do so please rm symlink to<br \/>\nsilex file and edit<\/p>\n<p><i>\/etc\/nginx\/sites-available\/default<\/i><br \/><i><br \/><\/i>Set root folder to \/var\/www<\/p>\n<p><i># &nbsp; &nbsp; &nbsp; root \/usr\/share\/nginx\/www;<\/i><br \/><i>&nbsp; &nbsp; &nbsp; &nbsp; root \/var\/www;<\/i><\/p>\n<div><\/div>\n<div>Add index.php as a index file<\/div>\n<div><\/div>\n<div><i>index index.html index.htm index.php;<\/i><\/div>\n<div><i><br \/><\/i><\/div>\n<div>And configure all <i>php&nbsp;<\/i>files to be parsed by fastCGI php bridge set up on port 9000. Just put all below somewhere in <i>default<\/i> file<\/div>\n<div><\/div>\n<div>\n<div><i>&nbsp;## Parse all .php file in the \/var\/www directory<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; location ~ \\.php$ {<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_split_path_info ^(.+\\.php)(.*)$;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_pass &nbsp; 127.0.0.1:9000;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_index &nbsp;index.php;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;SCRIPT_FILENAME &nbsp;\/var\/www\/silex$fastcgi_script_name;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; include fastcgi_params;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;QUERY_STRING &nbsp; &nbsp; $query_string;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;REQUEST_METHOD &nbsp; $request_method;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;CONTENT_TYPE &nbsp; &nbsp; $content_type;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_param &nbsp;CONTENT_LENGTH &nbsp; $content_length;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_intercept_errors &nbsp; &nbsp; &nbsp; &nbsp;on;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_ignore_client_abort &nbsp; &nbsp; off;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_connect_timeout 60;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_send_timeout 180;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_read_timeout 180;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_buffer_size 128k;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_buffers 4 256k;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_busy_buffers_size 256k;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fastcgi_temp_file_write_size 256k;<\/i><\/div>\n<div><i>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<\/i><\/div>\n<\/div>\n<div><\/div>\n<div>Now restart ngix as mentioned in original article and enjoy PHP on RPi!<\/div>\n","protected":false},"excerpt":{"rendered":"Totally awesome guide is at&nbsp;http:\/\/rasberrypibeginnersguide.tumblr.com\/post\/27283563130\/nginx-php5-on-raspberry-pi-debian-wheezyBut instead using provided silex site config file, you should configure root folder of web server to serve php scripts&#8230;.\n","protected":false},"author":22,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[416],"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/10979"}],"collection":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/comments?post=10979"}],"version-history":[{"count":16,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/10979\/revisions"}],"predecessor-version":[{"id":12161,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/10979\/revisions\/12161"}],"wp:attachment":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/media?parent=10979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/categories?post=10979"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/tags?post=10979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}