Ask a Question related to PHP Programming, Design and Development.
-
gumi_kr #1
PHP require +open_basedir problem
Hi,
I'm trying to use simple PHP function (requite) in subfolder but i get error:
Basicaly speaking, I've got two files:Warning: main() [function.main]: open_basedir restriction in effect. File(./wp-blog-header.php) is not within the allowed path(s): (/usr/local/share/httpd/htdocs/home/:/export/share/httpd/htdocs/home/:/var/tmp/) in /export/share/httpd/htdocs/home/***/wordpress/index.php on line 17
Warning: main(./wp-blog-header.php) [function.main]: failed to open stream: Not owner in /export/share/httpd/htdocs/home/***/wordpress/index.php on line 17
Fatal error: main() [function.require]: Failed opening required './wp-blog-header.php' (include_path='.:/usr/local/share/pear') in /export/share/httpd/htdocs/home/***/wordpress/index.php on line 17
1) test.php:
2) test2.phpPHP Code:<?php
require('test2.php');
?>
when I copy those files to /home/***/ and open test.php everything is finePHP Code:<?php
print('akuku')
?>
when I copy them to /home/***/wp/ i get the error
I checked following things:
-chmod seems to be ok (changed it to 777, but error still occurs)
-open_basedir value seems to be ok (open_basedir value in phpinfo(): "/home/:/var/tmp/"
- in phpinfo(): safe_mode off
Srver specification:
Apache/1.3.41 (Unix) PHP/4.4.7 mod_ssl/2.8.31 OpenSSL/0.9.8g
Please help!Last edited by gumi_kr; March 14th at 11:02 PM.
Junior Member
- Join Date
- Mar 2011
- Posts
- 2
-
open_basedir problem
Hi, on a virtual host, I get the following warning: Warning: is_file() : open_basedir restriction in effect.... -
#25782 [Opn->Bgs]: require( 'require.php' ) crashing Apache 1.3.28
ID: 25782 Updated by: sniper@php.net Reported By: akinder at technology-x dot com -Status: Open +Status: ... -
#25782 [Fbk->Opn]: require( 'require.php' ) crashing Apache 1.3.28
ID: 25782 User updated by: akinder at technology-x dot com Reported By: akinder at technology-x dot com -Status: ... -
#25782 [Opn->Fbk]: require( 'require.php' ) crashing Apache 1.3.28
ID: 25782 Updated by: sniper@php.net Reported By: akinder at technology-x dot com -Status: Open +Status: ... -
#25782 [NEW]: require( 'require.php' ) crashing Apache 1.3.28
From: akinder at technology-x dot com Operating system: Linux RedHat 9 PHP version: 5.0.0b1 (beta1) PHP Bug Type: Apache... -
Ravish #2
Re: PHP require +open_basedir problem
Looking at the error, it seems like it could be because of permissions.
Go through the following checklist:
- Is wp-blog-header.php located in same directory as index.php?
- Is apache running as 'nobody' or in SuExec mode?
- Check permissions of wp-blog-header.php, if user 'nobody' and your username is able to access it.
- Which user is the owner of both files and folders?
In most cases Apache would be running as user 'nobody' or your username if running in SuExec mode.
-
gumi_kr #3
Re: PHP require +open_basedir problem
Thank you for your reply!
1. Yes it is in the same directory
2. with phpinfo() i get "Server API = Apache " so I think it's not(?)
3/4. With SCP when I right-click on file I get group: nobody(60001), owner: gumi(479), an I can change chmods evn to 777 but It does not help.
Junior Member
- Join Date
- Mar 2011
- Posts
- 2



Reply With Quote



