openmediavault php无法运行的问题

根据官方文档的指引下安装openmediavault,一路来到apt安装软件包的步骤,php-fpm无法启动便无法继续后续,如下:


Apr 13 04:42:36 bananapim3 systemd[1]: Starting The PHP 7.3 FastCGI Process Manager...
Apr 13 04:42:36 bananapim3 php-fpm7.3[27202]: [13-Apr-2020 04:42:36] ERROR: unable to bind listening socket for address '/run/php/php7.3-fpm.sock': No such file or directory (2) 阅读更多 openmediavault php无法运行的问题

Nextcloud issues

The test with getenv(“PATH”) only returns an empty response

修改php-fpm中www.conf,将下面行的内容注释取消,重启php

;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp

nextcloud在nginx中的伪静态规则,在站点配置中添加一下内容:

location
~ ^/(data|config|\.ht|db_structure\.xml|README) {
deny all;
}

The “Strict-Transport-Security” HTTP header is not configured to least “15552000” seconds. For enhanced security we recommend enabling HSTS as described in our security tips.

在站点SSL配置文件添加一下内容(apache2: a2enmod headers)

NGINX:

add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";

APACHE:

 Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"

 

Something wordpress

php:
/etc/php5/fpm/pool.d/www.conf >>
listen = 127.0.0.1:9000 (#listen = /var/run/php5-fpm.sock)
listen.allowed_clients = 127.0.0.1

Nginx Site Config


location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;

 

# NOTE: You should have “cgi.fix_pathinfo = 0;” in php.ini

# With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

WordPress Rewrite

add content to

location /{
if (!-e $request_filename) {
rewrite (.*) /index.php;
}
}

 

DataBase

CREATE DATABASE wp;

GRANT ALL PRIVILEGES ON wp.* TO "wpuser"@"localhost" IDENTIFIED BY "password";