• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Interesting problem with PHP after upgrading to 8.1

E

EuroMaverick

Guest
Hello people,

I've got an intersting problem with PHP after upgrading from Plesk 7.6 to 8.1, which I was able to solve (although I don't really understand how it works !). Read on...

When I go to whatever site in my Plesk control panel and click the php-button, I get the following error message on top op the screen:
"Notice: Undefined index: 4 in C:\Program Files\SWsoft\Plesk\admin\htdocs\domains\php_changeversion.php on line 90"
and the PHP-version I should be using is not showed.

If this site actually already has PHP scripts running, sometimes it works, sometimes it does not (some simple stuff like displaying a text works, other more complex stuff like connecting to SQL databases results in errors).

When I go to the setup page of the site, I can see that PHP support is checked (version 5.2.0). I know un-check this (turn it off), click Ok, re-check it (turn it on) and click Ok.

If I now go the PHP-page in the Plesk control panel, I don't get the above error anymore, the page says I am working on version 5.2.0 and the website itself works fine too, with "simple" and "complex" PHP-code.

I have no idea what settings are changed when I go through this procedure, but it looks some things got not upgraded correctly from Plesk 7.6 to 8.1 and this is a procedure that works for me and might work for other people as well...

I have a feeling this has something to do the PHP-setup in general. I understand Plesk 8.1 gives the possibility to set up PHP 4 or 5 for each individual site, but I see nowhere where I can do that. I suppose something went wrong there...

I am an absolute novice in PHP, but I want to make sure it work fine for my customers, so anybody any comments on this PHP 4 and 5 that should be available both for each individual site in Plesk 8.1 ? Where should I find this setting and what should I do to solve this ?

Regards,

Mav.
 
Thank you for your comment on this. I am looking forward towards your findings...

in the meanwhile: any idead why this "double" PHP 4/5 option is not available ? Care to post a screenshot how this should look in the Plesk control panel ? I looked for it in the documentation, but there all I can find is a description of how it should work...

Regards,

Mav.
 
Any progress

I applied the Plesk 8.1.0 Update 061226.10 and now I can't select PHP5 in domain setup and I get the
Undefined index: 5 in C:\Program Files\SWsoft\Plesk\admin\htdocs\domains\php_change
version.php on line 90

on any sites that were already PHP5 under php settings. I tried uninstalling PHP5 and then reinstalling in ADD/Remove Programs. Still nothing.

HELP!
 
Hmm...sounds very much like what I had - see also http://forum.swsoft.com/showthread.php?s=&threadid=39304&perpage=15&pagenumber=2 how I solved this (actually "by accident" while I was solving a problem with the webmail).

QUOTE

After all kinds of different suggestions, finally solved my specific case by:
- Change Plesk 8.1 setup: remove webmail and PHP (both PHP and PHP5 as the installer calles it)
- Restart server
- Change Plesk 8.1 setup: add webmail and PHP (idem both)
- Restart server

And finally got it up-and-running ! Have solved on the fly the issue where I could not choose which PHP version is available for a domain - I can now indeed change between both.

Conclusion for me: although there are several reconfig tools and stuff you can do yourself, the above procedure cleans and reinstalls the whole thing more in depth and for me correctly...

UNQUOTE

Basically I'd suggest trying to uninstall PHP, restart, reinstall PHP and restart...

Let us know what comes out of it !

Regards,

Mav.
 
FIXED IT!!!

At least for me this was a matter of going into the PSA database on my MSSQL Server. Under the components table, the version for PHP5 was set to not installed eventhough I installed it and did so through plesk's installer.

I set this to the current version of PHP5 and this solved it! I can select the version I'm using in both domain setup and PHP settings.
 
For whoever is interested by it: I tought the previous reply of one of the SWSoft administrators on my question to post a screenshot of the "double" PHP option was rather lame ("here is the URL - try the demo online and watch it"), so I have inluced a screenshot in this message that show how it should look like...
 
I am not shure if anyone noticed this but, after reinstalling php4 and/or upgrading php5 with php5.2 sendmail_from is set to @adminemail@ and mails sent from php will not work anymore. This can of course be fixed by manually edit php.ini for php4 and for php5

About the php switching option:
If nothing works or something is wrong uninstall any previous version of php5 and install 5.2 from the plesk installation package. I guess is the same for php4, and do not forget to modify php.ini for both versions (at least the sendmail_from option) !!
 
Originally posted by EuroMaverick
Hello people,

I've got an intersting problem with PHP after upgrading from Plesk 7.6 to 8.1, which I was able to solve (although I don't really understand how it works !). Read on...

When I go to whatever site in my Plesk control panel and click the php-button, I get the following error message on top op the screen:
"Notice: Undefined index: 4 in C:\Program Files\SWsoft\Plesk\admin\htdocs\domains\php_changeversion.php on line 90"
and the PHP-version I should be using is not showed.

If this site actually already has PHP scripts running, sometimes it works, sometimes it does not (some simple stuff like displaying a text works, other more complex stuff like connecting to SQL databases results in errors).

When I go to the setup page of the site, I can see that PHP support is checked (version 5.2.0). I know un-check this (turn it off), click Ok, re-check it (turn it on) and click Ok.

If I now go the PHP-page in the Plesk control panel, I don't get the above error anymore, the page says I am working on version 5.2.0 and the website itself works fine too, with "simple" and "complex" PHP-code.

I have no idea what settings are changed when I go through this procedure, but it looks some things got not upgraded correctly from Plesk 7.6 to 8.1 and this is a procedure that works for me and might work for other people as well...

I have a feeling this has something to do the PHP-setup in general. I understand Plesk 8.1 gives the possibility to set up PHP 4 or 5 for each individual site, but I see nowhere where I can do that. I suppose something went wrong there...

I am an absolute novice in PHP, but I want to make sure it work fine for my customers, so anybody any comments on this PHP 4 and 5 that should be available both for each individual site in Plesk 8.1 ? Where should I find this setting and what should I do to solve this ?

Regards,

Mav.

It can occur in the following scenario:
1. install 7.6.1 with php4 support
2. create domain with php4
3. upgrade to 8.1
4. install php5 support
5. uninstall php4 support

Was it so?
 
I didn't do #5. I simply added PHP5 during my upgrade to 8.1. Everything worked until I did the Mid-January patch.

I did the patch through the plesk web interface.
 
Back
Top