So I managed to fumble around and update my server to PHP 8.1 via terminal. But… how do I get ClassicPress to actually use it?!
For reference, I used DigitalOcean’s 1-click setup with OpenLiteSpeed + ClassicPress.
phpmyadmin still lists the previous PHP version, 7.X. Do I need to do any additional configurations here?
Thanks in advance, and apologies for all the dumb questions.
I wonder if @getkoded007 can help.
So… it looks like I installed the wrong module.
When I first installed php 8, I used the instructions for Apache. Problem is, my server uses LiteSpeed. Oops!
I do see an option in LiteSpeed WebAdmin to update PHP through there, under Tools > Compile PHP. It only goes up to 8.1.1, but I can either make an edit to that or not worry about being on the cutting edge here.
So, now that I got that figured out… is this all I need to do? Besides making backups beforehand, of course.
what does php -v
give you through terminal.not sure how litespeed work, but it looks like you have add their repository then install uisng
sudo apt-get install lsphp81 lsphp81-common lsphp81-mysq
2 Likes
I tried to compile through OpenLiteSpeed panel and I get this error:
configure: error: in `/usr/local/lsws/phpbuild/php-8.1.11’:
configure: error: no acceptable C compiler found in $PATH
See `config.log’ for more details
ERROR Could not configure PHP build
I added the repository and commands according to instructions, but I still get this error. There is also
configure: error: in `/usr/local/lsws/phpbuild/php-8.1.11:
configure: error: no acceptable C compiler found in $PATH
What dependencies am I missing here?
EDIT I have also performed an update and upgrade of openlitespeed at this juncture.
“no acceptable C compiler found in $PATH” means exactly that: there’s no C-compiler in your exec-path to be found, so php won’t compile. So first install an acceptable c-compiler and all extra system c-libraries for php to build, then try again. Mind you: there will be some to install, so maybe your webadmin has an option to help you there too.
sudo apt-get install build-essential
I used this command and rebooted the server. I’m still unable to compile php via OpenLiteSpeed’s GUI, however. In a few days I will go over all I have done and see where I have gone wrong.
php needs many more system libs to compile, but I suppose that is out of scope for this forum. While this is for older php and ubuntu, it gives you an idea:
Newer php/ubuntu might require different steps (I’m a fedora/redhat user, so can’t say exactly), but normally the build instructions are explained on the php site itself.
Next tp that, make sure you actually want this … compiling php just as-is will result in a different result than expected (you need php-fpm too) and by default not integrated with systemd.
So, maybe the best is to search for an ubuntu/debian repo that gives you updated php repositories and use those.
If you have shell access, manually install PHP for OpenLiteSpeed as follows:
apt-get install lsphp83 lsphp83-common lsphp83-mysql lsphp83-curl lsphp83-imagick lsphp83-intl lsphp83-memcached
You then need to configure in the GUI that PHP binary path as an external App.
This is what I’ve decided to do. Sheesh.
I did learn a lot more about OpenLiteSpeed!
1 Like