installation/setting php8 in DirectAdmin

Foxhunt

New member
Joined
Sep 21, 2023
Messages
4
Hello,

I need help setting up PHP 8 on my VPS via Direct Admin.

After logging in to Direct Admin as an administrator and then as a resseler in the domain settings, I selected PHP 8, but then my Wordpress website stopped working, the following message was displayed:

"Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."

Please help me how to correctly set the PHP 8 version for a given domain in DirectAdmin. The latest Newspaper theme update requires this, so far my site has been working fine for many months on PHP 7.3.

Regards

Tomek


php_settings.jpg

custom_build_updates.jpg
 
How many RAM does your VPS have?
Does it also have a swap partition?

Because normally Wordpress works fine on php 8.0, so maybe either php 8.0 is not compile completely correct or a memory issue is preventing it from running correctly.

Also normally to switch a user to php 8 you use the user level, not reseller level. But maybe that is what you ment.
 
Hello,

Maybe I'll ask differently because I'd like to make sure I did everything correctly...

We are buying a new VPS with PHP 7.3, we want to have PHP 8.0, what steps do we perform in DirectAdmin? I think this information will help me.



Regards

Tomek
 
Hello.
So the VPS already contains php 7.3 and Directadmin?

Well there is nothing to it. Your screenshots look like they should. However since you asked, but be aware that I personally always use via console. So I log in via SSH and then:
cd /usr/local/directadmin/custombuild
then edit the options.conf file and set php80 on a position which is free, so if you want to keep php 7.3 as first php, then put php 8.0 second, as also shown in your own screenshots, with php-fpm.

Then save and close the file (it can also be added by command, but I do it the above way).
Next from within that directory:
Code:
./build update
./build php n
this will rebuild both php 7.3 and 8.0.
Or use the ./build php_expert command to only build php 8.0.

When that is done and finished correctly, you can login as the user, click on domain setup, then click on the domain and then in the upper right corner you will see "php version selector". Click on it and choose "PHP 8.0 php-fpm".
Click on "Save" and it should work for that domain.

What I describe is with Evo skin using the Icon Grid layout.

So as you see, I should be very easy.
 
Thank you for your detailed answer. I'm a graphic designer and photographer, not a programmer, which is why I have so many problems managing this server. Due to the above, I do not use the console only visually, which is why I posted these screenshots. Would it be possible to explain this to me more graphically? :)

In screenshot 2, I wonder why, with php 7.4 and php 8.0, the current version column is 0. As if php8 was not installed on the server? Do I understand that correctly?

When i click green button UPDATE i see this at end message:

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables SQLITE_CFLAGS
and SQLITE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

*** There was an error while trying to configure php. Check the configure file
 
I'm sorry. I'm not a graphical guy so I can't give you a more graphical explanation, the commands are just copy and paste.

The reason the column is 0, might be because it can not be detected which version exactly is installed.
Since you also have these other errors, which should not occur, I'm wondering if you waited long enough after installation of Directadmin before you started to do other things.

Because Directadmin is installed fairly quick, but all other things are installed in the background. And sometimes if too fast things are changed in Directadmin, before installation is finished, other things can go wrong.

However, to be able to be of help I really need an answer to my questions which I asked before.
How many RAM does the VPS have and is a swapfile present.

You can copy and paste these commands when logging in as root via SSH:
free
This command will show all memory, the amount of memory in use and it also shows if a swap file is in use, you would get to see something like this:

Code:
[root@server: ~]# free
               total        used        free      shared  buff/cache   available
Mem:        30805988     2900700    26365796      138084     1539492    27385780
Swap:        4194300        2328     4191972

This output is important.

Because there is a command which you can do in SSH to rebuild everything, but it has not a lot of use if there is no swapfile or you are too low on RAM.
 
Oke so you have 8 GB of ram but no swapfile, that's bad because swap is required. 8 GB ram is good enough.
You should create a swapfile of let's say 4 GB and then you should be fine for that part.

Instructions (use 4G):
You can skip step 8 as there is always a default value, I didn't use it either.

After that, reboot your vps and the swap should give you value(s).

Then use these commands, just copy and paste and put enter behind every line (hopefully I don't make typo's), be sure to issue these as root user:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build all d

Now this can take some time as all will be rebuild, apache, exim, php for example.
After this is totally ready without errors which stop the procedure (flying by errors or warnings might not be bad), then you should be able to use PHP 8.0.
 
Back
Top