[BlueOnyx:18672] Re: PHP & Cron Issue

Greg Kuhnert gkuhnert at compassnetworks.com.au
Mon Nov 16 01:24:43 -05 2015


Hi all

The command below will bypss open_basedir restrictions without going via the wget/curl method. This comes in handy when you dont want to expose your PHP scripts to the outside world for example...

/home/solarspeed/php/bin/php -d open_basedir=NULL /home/sites/www.mysite.com/web/myfile.php <http://www.mysite.com/web/myfile.php> 

GK

> On 16 Nov 2015, at 12:31 PM, Dan Porter <twinwolf.monitor at gmail.com> wrote:
> 
> I was not calling them that way - simply with:  php  /home/sites/www.mysite/myfile.php   Thanks I will give that a try and if that does not work then I will go with Maurice's suggestion.   Thanks for the ideas guys!!!
> 
> Dan
> 
> Dan Porter
> Twin Wolf Technology Group, LLC
> 
> On Sun, Nov 15, 2015 at 7:07 PM, Jim Matysek <matysekj at usms.org <mailto:matysekj at usms.org>> wrote:
> Are you explicitly referencing the Solarspeed PHP in your cron file? In my shell files that are executed by cron, I have to call php like this in order to get the Solarspeed version of php rather than the "stock" php from the server:
> 
> /home/solarspeed/php/bin/php /home/sites/www.mysite.com/myfile.php <http://www.mysite.com/myfile.php>
> 
> -jim
> 
>> I am hitting a brick wall.   I have a VPS with a single site.  It will never have more sites.   It has the PHP upgade and is running PHP version 5.6.12
>> 
>> A cron job has been setup by root to run a PHP script but it is giving the familiar open_basedir error as follows:
>> 
>> PHP Warning:  include(): open_basedir restriction in effect. 
>> File(/home/.sites/143/site2/web/home/include/init.inc.php) is not within the allowed path(s): (/tmp/:/var/lib/php/session/:/usr/sausalito/configs/php/:/usr/share/pear)
>> 
>> According to both the GUI and PHPinfo the open_basedir includes this path
>> 
>> Local value:
>> /var/lib/php/session/:/usr/sausalito/configs/php/:/tmp/:/home/solarspeed/php/share/pear:/home/.sites/143/site2/	
>> 
>> Master Value:
>> /var/lib/php/session/:/usr/sausalito/configs/php/:/tmp/:/home/solarspeed/php/share/pear:/home/.sites/143/site2/
>> 
>> If it helps, PHP Info also reported the following:
>> Configuration File (php.ini) Path	/home/solarspeed/php/etc
>> Loaded Configuration File	/home/sites/ <http://www.xxxxxxxxx.com/php.ini>www.XXXXXXXXX.com/php.ini <http://www.xxxxxxxxx.com/php.ini>
>> 
>> I am guessing some how this software is not looking at the php.ini file for the site.   Is that because it is in a root cron job?   What can I do to make this work?
>> 
>> 
>> Dan Porter
>> Twin Wolf Technology Group, LLC 
>> 
> 
> 
> 
> _______________________________________________
> Blueonyx mailing list
> Blueonyx at mail.blueonyx.it <mailto:Blueonyx at mail.blueonyx.it>
> http://mail.blueonyx.it/mailman/listinfo/blueonyx <http://mail.blueonyx.it/mailman/listinfo/blueonyx>
> 
> 
> _______________________________________________
> Blueonyx mailing list
> Blueonyx at mail.blueonyx.it
> http://mail.blueonyx.it/mailman/listinfo/blueonyx

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20151116/3ade55a7/attachment.html>


More information about the Blueonyx mailing list