Fixes in php for arch

This commit is contained in:
Antonio de la Rosa 2024-02-09 21:04:37 +01:00
parent c7d3f1b1ad
commit 92ae8e7d36
2 changed files with 17 additions and 7 deletions

View file

@ -621,13 +621,18 @@ def edit_virtualhost(virtualhost_id):
db=g.connection
vhost=VirtualHost(db)
virtual=VirtualHost(db)
#arr_vhost=virtual.select_a_row(virtualhost_id, [], True)
with virtual.query('select virtualhost.*, webserver.id, serverdbtask.distro from virtualhost, webserver, serverdbtask WHERE virtualhost.id=%s AND virtualhost.webserver_id=webserver.id AND webserver.server_id=serverdbtask.id', [virtualhost_id]) as cursor:
arr_vhost=cursor.fetchone()
#{'id': 3, 'domain': 'wp.cuchulu.com', 'home': '/home/developer/sites/wp.cuchulu.com', 'username': 'developer', 'webserver_id': 13, 'ip': '', 'port': 0, 'ssl_port': 0, 'cgi_type': '', 'ssl': 0, 'aliases': '', 'redirect_ssl': 0, 'indexes': 0, 'allow_override': 1, 'php': '', 'webserver.id': 13, 'distro': 'arch'}
arr_vhost=vhost.select_a_row(virtualhost_id, [], True)
if arr_vhost:
virtual=VirtualHost(db)
#virtual=VirtualHost(db)
virtual.fields['aliases'].label=I18n.lang('webservers', 'domain_alias', 'Domain aliases')
virtual.fields['aliases'].help=I18n.lang('webservers', 'domain_alias_explain', 'Domain aliases are the other domain names of this server. For example www.domain.com, other-site.domain.com. You can separate the domains with commas')
@ -667,7 +672,11 @@ def edit_virtualhost(virtualhost_id):
virtual.fields['php'].label=I18n.lang('webservers', 'php_support', 'PHP support')
virtual.fields['php'].name_form=SelectForm
virtual.fields['php'].extra_parameters=[{'': 'No php support', '7.4': 'PHP 7.4', '8.0': 'PHP 8.0', '8.1': 'PHP 8.1', '8.2': 'PHP 8.2', '8.3': 'PHP 8.3'}]
if arr_vhost['distro']!='arch':
virtual.fields['php'].extra_parameters=[{'': 'No php support', '7.4': 'PHP 7.4', '8.0': 'PHP 8.0', '8.1': 'PHP 8.1', '8.2': 'PHP 8.2', '8.3': 'PHP 8.3'}]
else:
virtual.fields['php'].extra_parameters=[{'': 'No php support', '8.1': 'PHP 8.1 (On Arch, php-legacy for maximum compatibility)'}]
virtual.fields['php'].help=I18n.lang('webservers', 'add_php_support_to_virtualhost', 'Add support to php to virtualhost. You can choose ophp version that you prefer')
#'port', 'ssl_port',

View file

@ -226,7 +226,8 @@ elif [ "$DISTRO" = 'rocky' ] || [ "$DISTRO" = 'fedora' ]; then
fi
else
sudo pacman -Syu --noconfirm
sudo pacman -S --needed --noconfirm php-legacy php-legacy-gd php-legacy-fpm php-legacy-sodium composer mariadb
if [ $? -eq 0 ]; then
@ -235,7 +236,7 @@ else
else
echo '{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Cannot install php legacy in arch..."}'
echo '{"error": 1, "status": 1, "progress": 100, "no_progress":0, "message": "Cannot install php legacy in arch..."}'
exit;