Netbook server notes: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
http://netbook.abuissa.net/test2.php 🙌 |
|||
32 bit! |
32 bit! |
||
<code>start-stop-daemon --background --start --exec /usr/bin/env -- /usr/bin/php-cgi -b 127.0.0.1:9000</code> |
<code>start-stop-daemon --background --start --exec /usr/bin/env -- /usr/bin/php-cgi -b 127.0.0.1:9000</code> |
||
[[/cdn-cgi/l/email-protection|[email protected]]]:~$ cat Public/test2.php |
|||
<pre> |
<pre> |
||
<?php |
<?php |
||
Latest revision as of 17:24, 26 October 2022
http://netbook.abuissa.net/test2.php 🙌
32 bit!
start-stop-daemon --background --start --exec /usr/bin/env -- /usr/bin/php-cgi -b 127.0.0.1:9000
[email protected]:~$ cat Public/test2.php
<?php
function display_command($command) {
echo $command;
echo "\n";
echo shell_exec($command);
echo "\n\n";
}
display_command("uptime");
display_command("sensors");
display_command("sudo hddtemp /dev/sda");
?>
/etc/nginx/sites-enabled/default
...
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
root /home/razzi/Public/;
}
# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# include /etc/nginx/fastcgi_params;
root /home/razzi/Public/;
# With php-fpm (or other unix sockets):
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# With php-cgi (or other tcp sockets):
fastcgi_pass 127.0.0.1:9000;
}
Stuff I installed
sudo apt install php7.2-cgi sudo apt install nginx