Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switched hosts - scripts no longer working!!!

Status
Not open for further replies.

smashing

Programmer
Oct 15, 2002
170
US
Hi Everyone!
I had my php scripts all up and running fine, but I had to dump the hosting company and switch to another company for various reasons. After exporting the database and rebuilding it on the new place, (I then dumped it and rewote everything by hand when I experienced the following problems) I am having trouble with a couple of my longer scripts, in which I get no error message just a blank screen!

I'm looking for differences in the PHP Configuration (<? phpinfo(); ?>) on both machines and for starters the old machine has display_errors set to on while the new one is set to off. Same with the asptags. I don't know where the problem could be and the ISP people don't provide much support. What should I look for?????
Please HELP!!!!!
 
Check if PHP runs in safe mode. If not, you can use ini_set to override the display_errors setting.

You can read it here:

This will allow you to inspect more closely what is going wrong. When you have more details, it will be easier to help.
 
For starters the reason you're getting a blank page is that the display_errors is set to off. Ask your ISP to turn that on in the php.ini file. Once that is on you should be able to see what problems your scripts are having and make the necessary adjustments. I've run into this problem a few times where scripts work on one build but not on the other. You can drive yourself nuts trying to figure it out.
 
Or, if your ISP doesn't want to do that, you can override the php.ini setting on a script-by-script level using ini_set():

Try adding:

ini_set('display_errors', 'on');
ini_set('error_reporting', 'E_ALL & ~E_NOTICE');

to the beginning of the offending scripts.
Want the best answers? Ask the best questions: TANSTAAFL!
 
Although the php info page lists my display_errors as off the people at my ISP insist that in the php.ini file it is listed as on. But to be sure I tried adding the two lines that sleipnir214 suggested but still doesn't help.

The script is a rather long and will be very tedious to check out, BUT the first half of it checks for correct user input (ie if they filled out each field and if not send them errors) AND IT WORKS FINE!!!! - that is if I don't fill out everything correctly the approriate error WILL appear.
Whereas if everything is filled out correctly it will go blank, which tells me that there is no typo in the script.

So it looks to me as if it starts getting stuck when I ask it to work with some different date functions. In particular this part:

//find out which day of the week it is both for admin & for database, and also which month it is called the nice way
$outdbdate = (&quot;2003-$_POST[outmonth]-$_POST[outday]&quot;);
$outcondate = gregoriantojd($_POST[outmonth],$_POST[outday],2003);
// now make day of week a number for the database
$weekd = jddayofweek($outcondate,0);
//the next line is needed here for max num capaities later on in the script
$highnumber = &quot;at the default number of 55&quot;;
//first make a nice weekday name for the admin people and for error messages regarding not rightfuly chosen days of the week
$niceweekd = jddayofweek($outcondate,1);
// now the error messages first of all if Saturday admin made a mistake because no buses availble on Saturday
if ($weekd == &quot;6&quot;) {
echo &quot;<br><h3>The date you chose is a <font color=red>Saturday,</font> please go back & choose another date</h3>&quot;;
exit;
}


Could it be that these built-in functions aren't somehow built in on this server, or what???
Please help 'cause I'm going nuts already!!!!
 
It seems to me that if PHP did not make those functions available, you'd get an error saying so. Something like &quot;Undefined function...&quot;.

Check the output of phpinfo() again. Does it have an entry which reads &quot;Calendar support.....enabled&quot;? Want the best answers? Ask the best questions: TANSTAAFL!
 
OK!! They forgot to refresh the VS server (or something) for the &quot;display_errors&quot; changes in the php.ini file to take effect. Now that &quot;display_errors &quot; is finally turned on, I do get an error message that reads:

Fatal error: Call to undefined function: gregoriantojd() in (my file references) on line 56

And YES - sleipnir214 you are right again (as always!) There is NO MENTION WHATESOEVER of calendar support whether enabled or not!
The ISP people are telling me now to enable the calendar support myself in the php.ini file, or to have them do it for some whopping service charge!!!
I bet sleipnir214 knows how to do it.
Let me know!!!! Thanks
 
Do I just have to add 2 or 3 lines to the file - and if so what are they- or is it a major thing??
Thanks sleipnir214
 
Hi! This is what one of the tech support guys at my ISP wrote after investigating the problem:

&quot;Hello, the message that I have gotten back from the administrators is that we really don't have access to recompile php on Sphera. you could compile
your own cgi version of php if you would like&quot;


So, I have no idea how to recompile PHP, or even how to compile it in the first place, all I did originaly was click some link in the Control Panels of my web site and it was installed.

Does anyone know the magic word for adding calendar support to the php.ini file?
I need it for the following functions:

gregoriantojd( );
jddayofweek( );
jdmonthname();

Maybe I can define these functions on each script on a script-by-script basis?

Please respond asap
Thanks
 
Sphera... ugh... :-( I had one brief encounter with the Sphera system when one of my old hosting service switched to it. I switched hosting services ASAP.

Smashing... do you have command-line access to this server? (telnet, SSH) -------------------------------------------

My PostgreSQL FAQ --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top