Project

General

Profile

[Solved] Running PHP

Added by baev_al over 8 years ago

Hi.
I cannot run php file.
I use armbian (Orange Pi Plus).
Server version: lighttpd/1.4.35 (ssl).
Browser: Google Chrome 53.0.2785.116

My index.html and index.php are located in /var/www

When I put my server IP in browser I see index.html page. When I add index.php to it (192.168.0.133/index.php) - nothing changes.

I'm totally new to all this stuff so if anyone can advise some book/resource it would be great.

Here is my config file:
server.document-root = "/var/www/index.html"

server.port = 80

mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)

server.modules += ( "mod_fastcgi" )

index-file.names += ( "index.php" )

fastcgi.server = (
".php" => ((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/lighttpd/php-fastcgi" + PID + ".sock",
"max-procs" => 4, # значение по умолчанию
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "1", # значение по умолчанию
"PHP_FCGI_MAX_REQUESTS" => "10000"
),
"broken-scriptfilename" => "enable"
))
)

fastcgi.map-extensions = ( ".php3" => ".php", ".php4" => ".php", ".php5" => ".php", "phtml" => "php" ) # если используете разные версии php


Replies (4)

RE: Running PHP - Added by gstrauss over 8 years ago

server.document-root = "/var/www/index.html"

Please try changing that to: server.document-root = "/var/www"

RE: Running PHP - Added by baev_al over 8 years ago

I changed server.document-root = "/var/www" the result is the same. I see index.html and when I add ../index.php nothing changes - I still see index.html.

RE: Running PHP - Added by baev_al over 8 years ago

Sorry. I restarted the server and everything is working. However, I could not stop properly the server with service lighttpd stop after this command server stopped and the process left (I am not sure that I use proper terminology). I need to kill the process with kill -9 lighttpd command. Did I make correct commands?

RE: Running PHP - Added by gstrauss over 8 years ago

Did I make correct commands?

Obviously not. You should not need to kill -9 lighttpd. Perhaps you were impatient with the restart and did kill -9 instead of waiting for lighttpd to finish serving existing requests (including keep-alive idle timeout).

Next time, please try 'service lighttpd restart'

    (1-4/4)