Page 1 of 1
[Solved] How to use PHP 7.3 in Ubuntu 18.04 ?
Posted: Fri Apr 05, 2019 8:36 am
by Spheerys
Hi,
I
have installed php7.3 on my server and by CLI, it is activated :
Code: Select all
php -v
PHP 7.3.3-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar 7 2019 20:31:49) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.3, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.3-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
But on my hosted websites, it's always php7.2 which is used : with a phpinfo(), I can verify this point.
v-rebuild-web-domains CLI command didn't solved the problem
What did I miss ?
Re: How to use PHP 7.3 in Ubuntu 18.04 ?
Posted: Fri Apr 05, 2019 10:02 am
by grayfolk
Restart apache.
Re: How to use PHP 7.3 in Ubuntu 18.04 ?
Posted: Fri Apr 05, 2019 10:05 am
by Spheerys
I did it (obviously)
Re: How to use PHP 7.3 in Ubuntu 18.04 ?
Posted: Fri Apr 05, 2019 5:45 pm
by Spheerys
I tried to remove php 7.2 but apache refuse to restart :
Code: Select all
avril 05 10:21:49 domain apachectl[1445]: AH00526: Syntax error on line 17 of /home/admin/conf/web/domain.net.apache2.conf:
avril 05 10:21:49 domain apachectl[1445]: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
avril 05 10:21:49 domain apachectl[1445]: Action 'start' failed.
avril 05 10:21:49 domain apachectl[1445]: The Apache error log may have more information.
avril 05 10:21:49 domain systemd[1]: apache2.service: Control process exited, code=exited status=1
avril 05 10:21:49 domain systemd[1]: apache2.service: Failed with result 'exit-code'.
avril 05 10:21:49 domain systemd[1]: Failed to start The Apache HTTP Server.
The line 17 is :
Code: Select all
php_admin_value open_basedir /home/admin/web/domain.net/public_html:/home/admin/tmp
Re: How to use PHP 7.3 in Ubuntu 18.04 ?
Posted: Fri Apr 05, 2019 5:54 pm
by grayfolk
Looks like mod_php not configured in apache config.
Re: How to use PHP 7.3 in Ubuntu 18.04 ?
Posted: Fri Apr 05, 2019 6:49 pm
by Spheerys
Hummm with the phpinfo(), I have this for the loaded modules :
Loaded Modules core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_actions mod_alias mod_auth_basic mod_authn_core mod_authn_file mod_authz_core mod_authz_host mod_authz_user mod_autoindex mod_deflate mod_dir mod_env mod_fcgid mod_filter mod_mime prefork mod_negotiation mod_php7 mod_reqtimeout mod_rewrite mod_rpaf-2 mod_ruid2 mod_setenvif mod_socache_shmcb mod_ssl mod_status mod_suexec
Edit : I did "a2enmod php7.3 "and I get this result :
Considering dependency mpm_prefork for php7.3:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php7.3:
Enabling module php7.3.
To activate the new configuration, you need to run:
systemctl restart apache2
But after the apache2 restart, the website are still using php 7.2 !!
Re: How to use PHP 7.3 in Ubuntu 18.04 ?
Posted: Fri Apr 05, 2019 6:56 pm
by Spheerys
OK solved : I had to also disable php7.2 module with :
and restart apache2
Thanks for your help grayfolk :)