I'm having some issues with one particular directory on my site, it cannot find my included php files that are outside of the root directory. What baffles me is that this is working for EVERY other page outside of this directory, but this particular directory will not set itself. I set my include paths in php.ini like so:
include_path = ".:/home1/(username)/inc:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear"
the files I'm trying to access are in the "inc" folder.
All I have in the file I'm running is include_once ('include.php');
which should, based on the php.ini settings, find the right file in the inc
directory.
I've tried a couple different things to remedy this including setting the include path like so:
include (dirname($_SERVER['DOCUMENT_ROOT'].'/inc/include.php');
which also cannot find the correct file.
As well as changing my .htaccess located within that folder to manually set the include path for that particular directory.
# ALLOW USER BY IP
<Limit GET POST>
order deny,allow
deny from all
allow from (ip of cron server)
</Limit>
# PREVENT VIEWING OF .HTACCESS
<Files .htaccess>
order allow,deny
deny from all
</Files>
#Set include path
php_value include_path ".:/home1/(username)/inc"
I am not sure if I did the .htaccess right but that method also produced the same error in my error.log file.
Heres the error.log file:
[05-Jul-2015 15:50:01] PHP Warning: include_once(include.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /home1/(username)/public_html/audit/check_expired_email_keys.php on line 7
[05-Jul-2015 15:50:01] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'include.php' for inclusion (include_path='.:/usr/lib64/php:/usr/share/pear') in /home1/(username)/public_html/audit/check_expired_email_keys.php on line 7
[05-Jul-2015 15:50:01] PHP Fatal error: Call to a member function query() on a non-object in /home1/(username)/public_html/audit/check_expired_email_keys.php on line 9
I'm at a loss right now for why this directory would fail to behave like the rest of the site is.
Some advice of any kind would really be helpful here.
Thanks in advance
::EDIT:: Issue was solved by moving cronjobs directly into super-root include directory.