Hello, I have a file called test.php. When I execute it I get: PHP Warning: main(ad_network_325.php): failed to open stream: No such file or directory in /path/to/my/test.php on line 3 Can someone give me a hand with this? Thanks tons J
is your directory really /path/to/my/test.php ??? if not make it the real path like for unix generally /home/username/html/test.php windows usually c:/somedir/html/test.php (i dont have much experience with windows servers so dunno)
Well, no, it's like that for privacy. Not only that, but this is in error_log on my webserver for this domain. It does show the correct path to test.php. Thanks, but I still need a fix for this error. It apparently can't find the ad script. Which is in the root of the website along with a chmod 666 .txt file of the same name. J
Before tryinig to include the adnetwork file, do you have the line (ini_set) where it changes the "path" variable for php? (see code below) If you don't have this line, the ad_network_325 file would need to be in the same directory as your text.php file. Also, if your ad_network_325 file is more than 4 directories up, it won't work. To help this, change this line ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../'); and ad more dots and slashes like so ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../:../../../../../:../../../../../../:../../../../../../../'); <?php ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../'); include ('ad_network_325.php'); echo $ad_network; ?> Code (markup): Also, the ad_network file needs to be in the base directory of the site. To get around these limitations, you could specify the correct path in the include. Hope some of that made sense
It made perfect sense, but same error, except with alot more dots and dashes. [client xxxxxxx] PHP Warning: main(ad_network_325.php): failed to open stream: No such file or directory in /path/to/my/picturepuppy/test.php on line 3 [client xxxxxxx] PHP Warning: main(): Failed opening 'ad_network_325.php' for inclusion (include_path='.:/usr/local/php/lib/php:../:../../:../../../:../../../../:../../../../../:../../../../../../:../../../../../../../') in /path/to/my/picturepuppy/test.php on line 3 [client xxxxxxx] PHP Notice: Undefined variable: ad_network in /path/to/my/picturepuppy/test.php on line 4 Code (markup): I have the php file in the root of the site, as well as the .txt file. Named and chmod'd properly. Thanks for trying. J
Try this: <?php include ('/path/to/my/website/ad_network_325.php'); echo $ad_network; ?> PHP: that should work
Unfortunately the same result. I may just have to give up. The setup is so simple though. Very frustrating. Thanks again frankm, J
are you VERY VERY sure the ad_network_325.php file exists in this location? http://www.picturepuppy.com/ad_network_325.php: 404 NOT FOUND while http://www.picturepuppy.com/ad_network_ads_325.txt : 200 OK maybe you made some type in the ad_network_325.php filename if so: IDIOT if not: sorry for calling you an idiot...
I wish I could be called an idiot, but check out this pic, taken minutes ago of the server's dir... Thank you for trying that, I didn't think to. Now...why would it not see it even if it's there? Ahah, YOU had the typo...... I'll try it now. OK, bad things happen. I renamed it. eeep. I don't think you can just call directly to the ad file....... Thanks J PS In the space of 30 seconds it created a 300MB error_log... I'm thinking it's a bad thing to call the script directly.
but I still get a 404 error ... It looks like the file does not exists (at least your apache server tells me so) try this: copy the file to a.php remove the original ad_network_325.php rename a.php to 'ad_network_325.php' and make sure there are not extra spaces, dots or _'s
I had to rename it. I couldn't have others connecting to that url..... it did bad things. I'll keep digging, I personally find it hard to drop anything without getting it running. Thanks J
i'm sorry i can't help you get it right jester -- good luck retrying When I get in a situation like this: just start all over again -- can do wonders good luck