Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | PHP: Buster support for Lighttpd + Nginx #1562

Merged
merged 2 commits into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dietpi/dietpi-services
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
'lighttpd'
'php5-fpm'
'php7.0-fpm'
'php7.2-fpm'
'mysql'
'mpd'
'ympd'
Expand Down
20 changes: 15 additions & 5 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -3529,7 +3529,7 @@ _EOF_
if [ -d /var/lib/mysql ]; then

G_DIETPI-NOTIFY 2 '/var/lib/mysql exists, will migrate containing databases'
G_RUN_CMD cp -a /var/lib/mysql/* "$G_FP_DIETPI_USERDATA/mysql/"
G_RUN_CMD cp -a /var/lib/mysql/. "$G_FP_DIETPI_USERDATA/mysql"

fi

Expand All @@ -3543,7 +3543,7 @@ _EOF_

G_DIETPI-NOTIFY 2 "Creating symlink: /var/lib/mysql -> $G_FP_DIETPI_USERDATA/mysql"
G_RUN_CMD ln -sf "$G_FP_DIETPI_USERDATA/mysql" /var/lib/mysql
chown -R mysql:mysql "$G_FP_DIETPI_USERDATA/mysql" &> /dev/null
G_RUN_CMD chown -R mysql:mysql "$G_FP_DIETPI_USERDATA/mysql"

G_AGI mariadb-server

Expand Down Expand Up @@ -7801,8 +7801,14 @@ _EOF_

cp /DietPi/dietpi/conf/nginx.conf /etc/nginx/nginx.conf
# - Stretch , set php7.0
if (( $G_DISTRO >= 4 )); then
if (( $G_DISTRO == 4 )); then

sed -i "s#/run/php5-fpm.sock#/run/php/php7.0-fpm.sock#g" /etc/nginx/nginx.conf

elif (( $G_DISTRO > 4 )); then

sed -i "s#/run/php5-fpm.sock#/run/php/php7.2-fpm.sock#g" /etc/nginx/nginx.conf

fi

# - CPU core count
Expand Down Expand Up @@ -7830,10 +7836,14 @@ _EOF_

#Configure fastcgi for PHP-FPM
local fp_php_fpm_sock='/var/run/php/php7.0-fpm.sock'
if (( $G_DISTRO == 3 )); then
if (( $G_DISTRO < 4 )); then

fp_php_fpm_sock='/var/run/php5-fpm.sock'

elif (( $G_DISTRO > 4 )); then

fp_php_fpm_sock='/var/run/php/php7.2-fpm.sock'

fi

cat << _EOF_ > /etc/lighttpd/conf-available/15-fastcgi-php.conf
Expand Down Expand Up @@ -12103,7 +12113,7 @@ _EOF_
# cat << _EOF_ > /etc/systemd/system/moode-worker.service
# [Unit]
# Description=moOde worker.php service
# After=php7.0-fpm.service php5-fpm.service apache2.service lighttpd.service nginx.service
# After=php7.2-fpm.service php7.0-fpm.service php5-fpm.service apache2.service lighttpd.service nginx.service

# [Service]
# Type=forking
Expand Down