Help - Search - Members - Calendar
Full Version: open_dir, safe_mode, include_path !help!
The Planet Forums > Control Panels > Plesk
g_a_t_e
Ello all,
Plesk is giving me major headaches today with everything..

Setup:
PHP Version 4.2.2
include_path is ".:/usr/share/pear" set as default

vhost.conf has (properly rebuilt with /usr/local/psa/admin/sbin/my_apci_rst -v -a) :
[PHP]

php_admin_value safe_mode 0
php_admin_value open_basedir "/home/httpd/vhosts/domain.com/httpdocs:/"
AddType application/x-httpd-php .html .php .htm

[/PHP]
questionnaire.html within /home/httpd/vhosts/domain.com/httpdocs/ has:
[PHP]
$i = 1;
include("questionnaire/q_flow.inc.php");
?>
[/PHP]

But when visiting it generates the error:
[PHP]
Warning: Failed opening 'questionnaire/q_flow.inc.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/domain.com/httpdocs/questionnaire.html on line 3
[/PHP]

File Structure:
/home/httpd/vhosts/domain.com/httpdocs/questionnaire.html is -rw-r--r-- correct user and group
/home/httpd/vhosts/domain.com/httpdocs/questionnaire/q_flow.inc.php is -rw-r--r-- correct user and group

Any ideas why this include doesn't work? any help much appreciated.
4PSA
Try to use the absolute path include("/path/file").
g_a_t_e
Yep,
[PHP]
$i = 1;
include("/home/httpd/vhosts/domain.com/httpdocs/questionnaire/q_flow.inc.php");
?>
[/PHP]

now results in:

[PHP]
Warning: Failed opening '/home/httpd/vhosts/domain.com/httpdocs/questionnaire/q_flow.inc.php' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/domain.com/httpdocs/questionnaire.html on line 3
[/PHP]

The curious thing is that when I do 'php questionnaire.html' everything executes perfectly, as if its apache causing the issues and not php?
Squire
Just a silly question while I'm flying through...

You did remember to restart apache after the vhost.conf was updated, correct?

Squire
g_a_t_e
Yes,
/usr/local/psa/admin/sbin/my_apci_rst -v -a does it whilst rebuilding the configs.
Squire
Sorry, I missed that one earlier gate. Was in too much of a hurry.

Though I will add that I've read posts before (way before) where folks had issues with my_apci_rst not acting exactly as was expected. I'll use that as my excuse for always using "service httpd stop" and "service httpd start" instead. icon_biggrin.gif You might try doing a total apache stop and start it again to make sure the restart is doing what it should, just to be safe.

I don't see anything at first glance going on with your vhost.conf. However I don't set things up so that .html files are pre-processed by the server either. To me that's just asking for trouble if you get a few fairly busy sites on the server and every files needs CPU power to deliver it. But as far as I know the method you're doing that is correct.

Have you tried hardcoding the include path in your vhost.conf for this domain just to see what happens? I seem to recall an old post over on the Plesk forums (about PHP and Pear if you want to search for it) where someone was getting the same error message and they got it to work by defining pear include path as part of their vhost.conf. I honestly don't remember the full details of the post, other than that they had something going on with their php.ini file. So you might want to do a search over on the Plesk forums.

If this the issue you're running into, your vhost.conf should go something like this:

[PHP]

php_value include_path /usr/share/pear
php_admin_value safe_mode 0
php_admin_value open_basedir /home/httpd/vhosts/domain.com/httpdocs:/usr/share/pear
AddType application/x-httpd-php .html .php .htm

[/PHP]

Hope that helps at least a little bit!

Squire
g_a_t_e
Argh you mother ferking, stupid son of a female dog @ PHP.

A simple chmod a+x questionnaire (dir) did the job (plus chmod a+x a few other include dirs.

Cheer for all your help,
Carl.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.