include paths
Posted: Tue Apr 26, 2005 5:34 am
im trying to run a php script that will work fine when i try to run it in a browser but wont recognise the include paths when i run in on the command line for some reason. (the program has to run on the command line because its part of a cron job)
heres just a simplified example of what im trying to do:
i have a file called test1.php in one directory called test1
i have another file called test2.php in another directory called test2
in test1.php i have the include path "include_once ('../test2/test2.php');
now if im right file test2.php should be included in test1.php
if i run test1.php in the browser it works fine. however, if run it on the command line using the following command: "c:\wamp\php\php.exe -c c:\wamp\apache\php.ini -q c:\wamp\www\test1\test1.php"
i get an error saying that it failed to open ../test2/test2.php in c:\wamp\www\test1\test1.php.
if i take the include path out of test1.php and run it in the command line, test1.php executes perfectly so i know its not a problem with the command im using
anyone know how to fix this??? im using windows, dunno if that effects include paths or not...
heres just a simplified example of what im trying to do:
i have a file called test1.php in one directory called test1
i have another file called test2.php in another directory called test2
in test1.php i have the include path "include_once ('../test2/test2.php');
now if im right file test2.php should be included in test1.php
if i run test1.php in the browser it works fine. however, if run it on the command line using the following command: "c:\wamp\php\php.exe -c c:\wamp\apache\php.ini -q c:\wamp\www\test1\test1.php"
i get an error saying that it failed to open ../test2/test2.php in c:\wamp\www\test1\test1.php.
if i take the include path out of test1.php and run it in the command line, test1.php executes perfectly so i know its not a problem with the command im using
anyone know how to fix this??? im using windows, dunno if that effects include paths or not...