The officially official Devuan Forum!

You are not logged in.

#1 2022-12-30 03:00:53

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

[SOLVED] php-fpm line missing from /var/run/php/

Following instructions here:
https://linuxiac.com/how-to-configure-n … a-php-fpm/

All is good until I get here:

ls -l /var/run/php/

total 4
-rw-r--r-- 1 root     root      5 Dec  1 17:43 php7.4-fpm.pid
srw-rw---- 1 www-data www-data  0 Dec  1 17:43 php7.4-fpm.sock
lrwxrwxrwx 1 root     root     30 Dec  1 17:43 php-fpm.sock -> /etc/alternatives/php-fpm.sock

The third line is missing.

Do I take it as my needing to create a symlink for that somehow?

Note: I just installed php-fpm via the Synaptic Package Manager.

Thanks

Offline

#2 2022-12-30 03:20:48

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [SOLVED] php-fpm line missing from /var/run/php/

You may follow that instruction without worrying about that link.

The link is likely a side effect of having installed multiple variant php*-fpm for experimentation, and then they configured nginx to use the link pathname for the socket instead of the direct pathname. In that way the nginx configuration need not be changed when the "alternatives" configuration is changed for a different php*-fpm version.

Offline

#3 2022-12-30 03:34:51

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

OK, cool ... got internal web pages to serve ... onward to serving them outside ...

Thanks

Offline

#4 2022-12-30 03:49:20

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

Unfortunately I'm not getting the graphic shown in Step 4.

echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php

It just generates a single line of text in a file named info.php (contents are "<?php phpinfo(); ?>") - that file isn't opened but is downloaded when I visit 127.0.0.1/info.php in a web browser.

Offline

#5 2022-12-30 03:58:32

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [SOLVED] php-fpm line missing from /var/run/php/

Does /etc/nginx/sites-enabled have more than the link to your config?

The alphabetically first of any pathnames there will be the virtual server configuration that handles access without proper server name ("127.0.0.1").

For testing, you may temporarily add a line to /etc/hosts to allow direct access via your external server name:

127.0.0.1 example.com

for trialling http://example.com/info.php (or even https://example.com/info.php once the SSL credentials have been set up)

Offline

#6 2022-12-30 04:23:56

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

I tried ... no joy.

It's getting too late for me to stay focused. I'll have to return to this in the morning.

Thanks!

Offline

#7 2022-12-30 06:18:55

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [SOLVED] php-fpm line missing from /var/run/php/

As you might know:

nginx provides execution logs as /var/log/nginx/access.log and/or /var/log/nginx/error.log

php7.4-fpm provides execution logs as /var/log/php7.4-fpm.log

Offline

#8 2022-12-30 19:31:41

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

Nothing stands out in any of those three logs.

I'd previously corrected code errors in nginx.conf and there were no errors in the php7.4-fpm log.

Last edited by dcolburn (2022-12-30 19:42:35)

Offline

#9 2022-12-30 21:07:22

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

Do I need to install the "Unit" Control API?

https://unit.nginx.org/controlapi/

Offline

#10 2022-12-30 21:40:07

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [SOLVED] php-fpm line missing from /var/run/php/

No.

Rather, please show the content (with ls -l) of /etc/ngiginx/sites-enabled/, and your nginx configuration file.

Offline

#11 2022-12-30 22:09:37

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

root@devuan1:/etc/nginx/sites-enabled# ls -l
total 0
lrwxrwxrwx 1 root root 40 Dec 29 21:53 realupnow.com -> /etc/nginx/sites-available/realupnow.com
lrwxrwxrwx 1 root root 39 Dec 29 21:17 website1.com -> /etc/nginx/sites-available/website1.com
lrwxrwxrwx 1 root root 39 Dec 29 21:17 website2.com -> /etc/nginx/sites-available/website2.com
lrwxrwxrwx 1 root root 34 Dec 24 21:35 xdefault -> /etc/nginx/sites-available/default
root@devuan1:/etc/nginx/sites-enabled#

user www-data;
error_log logs/error.log notice;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
include conf.d/http;
include conf.d/stream;
include conf.d/exchange-enhanced;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##

Offline

#12 2022-12-30 22:18:09

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [SOLVED] php-fpm line missing from /var/run/php/

Ah, with "configuration file" I meant the service configuration, which presumably is /etc/nginx/sites-available/realupnow.com.

And to make it easier for you to debug, you should remove the other links in /etc/nginx/sites-enabled (and restore them later). ... and restart nginx

Offline

#13 2022-12-30 22:23:55

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

##
# Virtual Host configuration for realupnow.com
#
# Be sure to symlink that to sites-enabled/ to enable it.
# sudo ln -s /etc/nginx/sites-available/realupnow.com /etc/nginx/sites-enabled/realupnow.com
#
server {
    listen 80;
    root /var/www/realupnow.com;
    index index.php index.html index.htm;
    server_name realupnow.com;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    }
}

Offline

#14 2022-12-30 22:26:57

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

Should realupnow.com permissions be root?

"sudo service nginx restart" failed.

I've not seen that before ...

Offline

#15 2022-12-30 22:48:51

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [SOLVED] php-fpm line missing from /var/run/php/

Look at end of /var/log/nginx/error.log.

Directory /var/www/realupnow.com exists and is readable by www-data ?

php7.4-fpm is started?

btw, code things (like configuration files) are best displayed with code tagging rather than quote tagging since that will avoid word-wrap linebreaks that otherwise might cause confusion.

Offline

#16 2022-12-30 23:02:11

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

2022/12/30 17:25:34 [emerg] 4042#4042: open() "/etc/nginx/sites-enabled/website1.com" failed (2: No such file or directory) in /etc/nginx/nginx.conf:64

I think the problem is here:

include /etc/nginx/modules-enabled/*.conf

I deleted the symlinks to default.com, website1.com, and website2.com from /etc/nginx/sites-enabled

Also, realupnow.com is now a folder in /var/www/ and index.html is in that folder. Both are now also set to www-data:www-data

root@devuan1:~# sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@devuan1:~# sudo service nginx restart
Restarting nginx: nginx.
root@devuan1:~# 

Last edited by dcolburn (2022-12-30 23:20:00)

Offline

#17 2022-12-30 23:14:14

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [SOLVED] php-fpm line missing from /var/run/php/

Right; remove all links from /etc/nginx/sites-enabled/ except the one for your service configuration.

And: nginx needs to be restarted after any changes to its configuration files. (Sometimes "reload" is enough, but that's really only a consideration for a busy live site).

Offline

#18 2022-12-30 23:29:14

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

/etc/nginx/sites-enabled/ only now contains realupnow.com

127.0.0.1 and 192.168.50.4 both take me to nginx.

https://www.realupnow.com is not found.

How do I test for the server path to realupnow.com, please?

Last edited by dcolburn (2022-12-30 23:40:21)

Offline

#19 2022-12-30 23:52:13

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 1,106  

Re: [SOLVED] php-fpm line missing from /var/run/php/

Firstly, the configuration does not include SSL setup so the service is http and not https.

Next, you will need to convince your browser that the FQDN (fully qualified domain name) realupnow.com resolves to the IP address 127.0.0.1 (or the other one if you prefer, since nginx listens on all interfaces, i.e. both lo and eth0).

Traditionally a browser would end up using the standard libc function gethostbyname to determine the IP adddress to use, and this is technically configured via /etc/nsswitch.conf and /etc/hosts. If all is per traditionally normal, then it is enough to add a line to /etc/hosts:

127.0.0.1 realupnow.com

(with a terminating newline). That would declare the DNS resolution for realupnow.com to be 127.0.0.1.

More recently browser developers have introduced new and interesting ways of resolving domain names, so it's possible that this won't work for you. In that case, you should install surf and trial this via the command line start:

$ surf http://realupnow.com/info.php

Unless of course, you rather enjoy some browser wrestling smile

Note that it's http without a trailing s.

Offline

#20 2022-12-31 02:28:18

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

You've given me some good things to study and resolve.

I guess I first need to set up SSL.

Then proceed from there.

(BTW: http://realupnow.com does resolve from the default Devuan browser on the server. It doesn't resolve from my laptop. I have https-only turned off in the Ghostery Dawn browser - on my laptop.)

Thanks!

Last edited by dcolburn (2022-12-31 02:39:50)

Offline

#21 2023-01-23 03:21:45

dcolburn
Member
Registered: 2022-11-02
Posts: 280  

Re: [SOLVED] php-fpm line missing from /var/run/php/

In the process of some new troubleshooting I revisited this part of your previous reply.

Devuan, or something, doesn't seem to like surf ...

ralph.ronnquist wrote:

More recently browser developers have introduced new and interesting ways of resolving domain names, so it's possible that this won't work for you. In that case, you should install surf and trial this via the command line start:

$ surf http://realupnow.com/info.php

Unless of course, you rather enjoy some browser wrestling smile

Note that it's http without a trailing s.

root@devuan1:~# surf http://realupnow.com/info.php

** (surf:5562): WARNING **: 22:11:30.126: Could not open /sys/class/dmi/id/chassis_type: Failed to open file “/sys/class/dmi/id/chassis_type”: Permission denied

** (surf:5562): WARNING **: 22:11:30.126: Could not open /sys/firmware/acpi/pm_profile: Failed to open file “/sys/firmware/acpi/pm_profile”: Permission denied

** (surf:5562): WARNING **: 22:11:30.149: webkit_web_context_set_additional_plugins_directory is deprecated and does nothing. Netscape plugins are no longer supported.

** (surf:5562): WARNING **: 22:11:30.149: webkit_web_context_set_additional_plugins_directory is deprecated and does nothing. Netscape plugins are no longer supported.

(WebKitWebProcess:5576): Gtk-WARNING **: 22:11:30.291: Theme parsing error: gtk-widgets.css:1345:25: The style property GtkRange:slider-width is deprecated and shouldn't be used anymore. It will be removed in a future version

(WebKitWebProcess:5576): Gtk-WARNING **: 22:11:30.291: Theme parsing error: gtk-widgets.css:1346:25: The style property GtkRange:stepper-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(WebKitWebProcess:5576): Gtk-WARNING **: 22:11:30.291: Theme parsing error: gtk-widgets.css:1347:34: The style property GtkScrollbar:min-slider-length is deprecated and shouldn't be used anymore. It will be removed in a future version

(WebKitWebProcess:5576): Gtk-WARNING **: 22:11:30.291: Theme parsing error: gtk-widgets.css:1348:28: The style property GtkRange:stepper-spacing is deprecated and shouldn't be used anymore. It will be removed in a future version

(WebKitWebProcess:5576): Gtk-WARNING **: 22:11:30.291: Theme parsing error: gtk-widgets.css:1349:34: The style property GtkRange:trough-under-steppers is deprecated and shouldn't be used anymore. It will be removed in a future version

** (WebKitWebProcess:5576): WARNING **: 22:11:30.538: Could not open /sys/class/dmi/id/chassis_type: Failed to open file “/sys/class/dmi/id/chassis_type”: Permission denied

** (WebKitWebProcess:5576): WARNING **: 22:11:30.538: Could not open /sys/firmware/acpi/pm_profile: Failed to open file “/sys/firmware/acpi/pm_profile”: Permission denied
Could not read style file: /root/.surf/styles/default.css
root@devuan1:~# 

Offline

Board footer