View Full Version : Server Path and PHP problems
soccertalks
10-16-04, 08:24 AM
I am one of the users affected by the recent problems with PHP on my site.
I had a PHP script to include Random quotes on my front page . This stopped working last week and I was having the same problems as others with the page loading slowly and errior messages with my script.
After reading this forum I thought the problem was because of the path I was using to the script file so I changed it to what I think is the server path, below but this did not solve my problem. I have also put the Powweb default PHP.ini file in the root of my site . They are the only changes I have made. Can anyone advise me on how to fix this problem. You can see what is happening in the left column at http://www.soccertalks.com/index1.php
<?php include("/www/u/soccertalks/htdocs/randomquotes/randomquotes.php") ?>
TIA
Tom
Hi Soccertalks,
I didn't take much care to the Powweb announcement about /tmp in php because I don't use it for my website, so I'm not able to tell you much about it but taking anyway a look to your page, I saw some strange thing, here below in red (compare to what's in green):
Warning: main(/www/u/soccertalks/htdocs/randomquotes/randomquotes.php): failed to open stream: No such file or directory in /www/s/soccertalks/htdocs/index1.php on line 376
Warning: main(): Failed opening '/www/u/soccertalks/htdocs/randomquotes/randomquotes.php' for inclusion (include_path='.:/usr/local/php4/lib/php') in /www/s/soccertalks/htdocs/index1.php on line 376
soccertalks
10-16-04, 08:43 AM
Hi Soccertalks,
I didn't take much care to the Powweb announcement about /tmp in php because I don't use it for my website, so I'm not able to tell you much about it but taking anyway a look to your page, I saw some strange thing, here below in red (compare to what's in green):
Warning: main(/www/u/soccertalks/htdocs/randomquotes/randomquotes.php): failed to open stream: No such file or directory in /www/s/soccertalks/htdocs/index1.php on line 376
Warning: main(): Failed opening '/www/u/soccertalks/htdocs/randomquotes/randomquotes.php' for inclusion (include_path='.:/usr/local/php4/lib/php') in /www/s/soccertalks/htdocs/index1.php on line 376
Thanks for your Help JLOVI . I tried that and it gives me a different error.Here is a link to the change page http://www.soccertalks.com/index2.php.
Thansk for the suggestion the page loads quicker now but its not showing teh script . I do not know enought about php to understand what is happening so an help would be appreciated.
Tom
Warning: Unknown(../randomquotes/config.php): failed to open stream: No such file or directory in /www/s/soccertalks/htdocs/randomquotes/codelock.php(3) : eval()'d code(1) : eval()'d code on line 2
Warning: (null)(): Failed opening '../randomquotes/config.php' for inclusion (include_path='.:/usr/local/php4/lib/php') in /www/s/soccertalks/htdocs/randomquotes/codelock.php(3) : eval()'d code(1) : eval()'d code on line 2
This is the quote script by www.liquidfrog.com - I can't find the file called thequotes.txt
which I need to operate correctly. Please check the server to make sure the file is there.
That error message is more understandable to me. You just need to place the "thequote.txt" file at a place the script is able to access. What I would do if I really was stuck, is to take a look at the php source file to modify the code to control myself where the file has to be placed. Maybe a bit quick and dirty but it sometimes saves a lot of time ;)
soccertalks
10-16-04, 09:05 AM
The Randomquotes script is codelocked so it can not be edited AFAIK. There is a config,php file to make changes but there is nowhere to change the path to thequotes.txt which is in the randomquotes folder by default . This script was working fine on my page up to last weekend.
Thanks for you help jlovi .
Tom
Give this a try...
Put (or actually copy) the new php.ini file into the randomquotes subfolder as well as in your htdocs folder.
This is pure speculation, but I've had to put a copy of php.ini into almost every folder that I'm using to run php code.
hth
symo
soccertalks
10-16-04, 09:48 AM
Give this a try...
Put (or actually copy) the new php.ini file into the randomquotes subfolder as well as in your htdocs folder.
This is pure speculation, but I've had to put a copy of php.ini into almost every folder that I'm using to run php code.
hth
symo
Thanks Symo
I tried that its still not working. I have php running fine in different folders this is the only one not working .
Tom
This is pure speculation, but I've had to put a copy of php.ini into almost every folder that I'm using to run php code.
You can just put one php.ini in htdocs and it will work for every directory within.
Looks to me like the include path makes no sense. You are going up on directory, then down into randomquotes directory then looking for the file. Is that where the file is?
You can just put one php.ini in htdocs and it will work for every directory within.
Unless you are using subdomains at the same level as htdocs, then you need to put one in each of the subdomain's htdocs directory. This one tripped me up during the change over with the session.save_path thing. That of course may have changed now as I believe you don't need to worry about saving the sessions info in your own space again, although I was having trouble with my gallery uploading last night, until I added the php.ini file into it's htdocs. :confused:
I was grasping at anything that might have helped :rolleyes:
symo
soccertalks
10-16-04, 12:34 PM
Looks to me like the include path makes no sense. You are going up on directory, then down into randomquotes directory then looking for the file. Is that where the file is?
HI B&T
This worked fine until last weekend. I made no changes to my site until it stopped working. The quotes file is in the folder Randomquotes but it looks to me that I have to put the server path to that file into the script. The problem is that the scrip is codelocked and the path can not be edited.
I.m new to php so I,m not sure if this is an accurat fault diagnosis I,m hopinh someone here can point me in the right direction even if that is sourcing a different script for the quotes.
Thanks
Tom
HI B&T
This worked fine until last weekend. I made no changes to my site until it stopped working. The quotes file is in the folder Randomquotes but it looks to me that I have to put the server path to that file into the script. The problem is that the scrip is codelocked and the path can not be edited.
I.m new to php so I,m not sure if this is an accurat fault diagnosis I,m hopinh someone here can point me in the right direction even if that is sourcing a different script for the quotes.
Thanks
Tom
I'm very new to php and don't use it, but do follow the threads in here and the announcements.
It looks to me that you've changed the relative path (../randomquotes/ etc) part to an absolute path (/www/s/soccertalks/htdocs/index1.php) once, but not on all of the pages. Apparently it is necessary to change it on all references.
So I would agree with your fault diagnosis and would start looking for a different script for pulling up the quotes.
EDIT:
BTW: I could read thequotes.txt file directly at http://www.soccertalks.com/randomquotes/thequotes.txt
I did a quick search of B&T's scripts (visual search - sorry) and couldn't find anything to do the job of randomquotes. However, doing a search on Yahoo.co.uk got me (via other pages) to a source of a script that looks like it does what you intend. Here (http://www.cj-design.com/index.php?id=downloads&page=10) is a link - I can't verify if it works, nor can I help with problems as I don't know enough but others will be able to.
soccertalks
10-16-04, 03:59 PM
Thanks IanS
I thought I had deleted alll the other instances of the script on the site. I will double check and see if theres anything like that wrong.
Interestingly I have noticed that the Script is showing the Random Quotes on the faulty page at the bottom of all the error messages so it must be seeing the quotetxt file.
Thanks for the link to the script if all else fails I will have to use something like that.
Cheers
Tom
soccertalks
10-17-04, 09:55 AM
Ok I tried everything to get my original script working but to no avail. I have changed the quotes script to the one linked by IanS and its working fine . Thanks to all who tried to help hopefully I can return the help some day.
Cheers
Tom
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.