I'm a fan of using URI paths to control websites. It's neat and clean, but after upgrading to Plesk 12.5 with PHP 7 it stopped working. So, rather than using example.com?action1=&action2=, I use example.com/action1/action2.
What happens is this. Any normal PHP files (e.g., example.com/index.php) are interpreted by Plesk's installation of PHP (specifically 7.0.19). This starts a session, stores some $_SESSION variables, and off we go. But as soon as I use my beloved URI commands, despite (e.g.) action1 being symbolically linked to index.php, it's processed by the server's installation of PHP. I eventually got that to PHP 7.0.20, but there are apparently enough differences between the two installations that one can't/won't read the other's session file. Some code:
ln -s index.php action1
index.php contains:
<?php
session_start();
if(TRUE) $_SESSION['test'] = 'successful';
print_r($_SESSION);
echo "<P>".session_id();
echo "<P>".phpinfo();
.htaccess contains
RewriteEngine On
RewriteBase /
AddHandler application/x-httpd-php .php
<Files action1>
SetHandler application/x-httpd-php
</Files>
Set TRUE and visit example.com/index.php. The $_SESSION variable is set. The session file is populated. Set to FALSE and we see the session file is read. My server's phpinfo() in this instance reports 7.0.19 (Plesk's).
Now visit example.com/action1. The variable disappears, but the session ID is the same. phpinfo() now reports the server's PHP 7.0.20.
Is there any way to ...
(A) force the server to use Plesk's install of PHP? This would have been easy but for an absolutely inexplicable reason Plesk 12.5 does not ship with libphp7.so for its PHP installation. Honestly, that's unbelievable. Or...
(B) force all HTTP calls to go through Plesk? That means after the .htaccess voodoo it's Plesk's Apache that's tapped and not the server's Apache. Or...
(C) Some other cool juju I haven't thought of.
It's taken me four days to get to this point and while walking away from my beloved URI paths is (an increasingly likely) option, I'm hoping it isn't necessary. Can anyone point out a way for .htaccess-modified URIs to use Plesk's Apache rather than the server's default?
THANKS!
What happens is this. Any normal PHP files (e.g., example.com/index.php) are interpreted by Plesk's installation of PHP (specifically 7.0.19). This starts a session, stores some $_SESSION variables, and off we go. But as soon as I use my beloved URI commands, despite (e.g.) action1 being symbolically linked to index.php, it's processed by the server's installation of PHP. I eventually got that to PHP 7.0.20, but there are apparently enough differences between the two installations that one can't/won't read the other's session file. Some code:
ln -s index.php action1
index.php contains:
<?php
session_start();
if(TRUE) $_SESSION['test'] = 'successful';
print_r($_SESSION);
echo "<P>".session_id();
echo "<P>".phpinfo();
.htaccess contains
RewriteEngine On
RewriteBase /
AddHandler application/x-httpd-php .php
<Files action1>
SetHandler application/x-httpd-php
</Files>
Set TRUE and visit example.com/index.php. The $_SESSION variable is set. The session file is populated. Set to FALSE and we see the session file is read. My server's phpinfo() in this instance reports 7.0.19 (Plesk's).
Now visit example.com/action1. The variable disappears, but the session ID is the same. phpinfo() now reports the server's PHP 7.0.20.
Is there any way to ...
(A) force the server to use Plesk's install of PHP? This would have been easy but for an absolutely inexplicable reason Plesk 12.5 does not ship with libphp7.so for its PHP installation. Honestly, that's unbelievable. Or...
(B) force all HTTP calls to go through Plesk? That means after the .htaccess voodoo it's Plesk's Apache that's tapped and not the server's Apache. Or...
(C) Some other cool juju I haven't thought of.
It's taken me four days to get to this point and while walking away from my beloved URI paths is (an increasingly likely) option, I'm hoping it isn't necessary. Can anyone point out a way for .htaccess-modified URIs to use Plesk's Apache rather than the server's default?
THANKS!