HELP! - Site Has Disappeared On PHP Upgrade

Hi,



I have just upgraded our server from php 4 to 5. The upgrade went fine and all other sites on the server are ok, but my CS CART site is having problems - IE I just get a blank screen!



I know CS Cart throws a blank screen if there is a problem in the code, but this means there is no way to track down the problem.



There is some customisation that has been done on our installation by CS CART developers, but I have no idea what is causing the problem or how to resolve it.



Can anyone please help.



Thanks

I know there is a different answer, but this happened to me.

My host asked if they could upgrade php version. I said sure. why not?

They installed the newest version, and the same thing happened. We just kept “rolling back” the version and testing.

We had success with PHP Version 4.4.7.

I am using 1.3.4 sp3



I am not sure why, maybe a config setting or something…maybe one of the techie type posters can shed some light on this.

[quote name=‘MikeFold’]I know there is a different answer, but this happened to me.

My host asked if they could upgrade php version. I said sure. why not?

They installed the newest version, and the same thing happened. We just kept “rolling back” the version and testing.

We had success with PHP Version 4.4.7.

I am using 1.3.4 sp3



I am not sure why, maybe a config setting or something…maybe one of the techie type posters can shed some light on this.[/QUOTE]



Thanks - atleast I’m not the only one. However I have to have PHP5 running as its needed for other sites on the same server.



Do any tech’s know what the problem is - or even how I can possibly try and debug it myself - with just getting a blank screen and no error reports its an impossible task.

I was running 134sp3 with PHP5.2.3 with no problems so I am not sure what to tell you on this particular problem. I did have to create a php.ini file to imply what version to use but that was only because my server is using PHP4.4.7 but has PHP5.2.3 implemented if that makes any sense.

[quote name=‘Texas Trophy’]I was running 134sp3 with PHP5.2.3 with no problems so I am not sure what to tell you on this particular problem. I did have to create a php.ini file to imply what version to use but that was only because my server is using PHP4.4.7 but has PHP5.2.3 implemented if that makes any sense.[/QUOTE]



I’m completely stumped. Does anyone know how I can get error reporting working so I can try and figure what the problem is - without error reporting there’s no way of finding out.



Thanks

Do you have a way of tracking error logs on the server end? I have CPanel whereas it tracks error logs.

[quote name=‘Texas Trophy’]Do you have a way of tracking error logs on the server end? I have CPanel whereas it tracks error logs.[/QUOTE]



It doesn’t seem to be showing anything unusual in the error logs - I doubt php errors would show up there anyway?

Try this in your config.php file:



From this:

// Uncomment this line if you experience problems with mysql5 server
//define('MYSQL5', true);






To this:

// Uncomment this line if you experience problems with mysql5 server
define('MYSQL5', true);

Oops. Nevermind. I just realized that was sql not php.

[quote name=‘Texas Trophy’]Try this in your config.php file:



From this:

// Uncomment this line if you experience problems with mysql5 server
//define('MYSQL5', true);






To this:

// Uncomment this line if you experience problems with mysql5 server
define('MYSQL5', true);
[/QUOTE]



Well if I do that it gives me this output:


Database error: 1193 : Unknown system variable 'sql_mode'
Invalid query: set @@sql_mode=''

Backtrace:
File: /home/stagbase/public_html/index.php
Line: 43
Function: require
File: /home/stagbase/public_html/init.php
Line: 75
Function: db_query
File: /home/stagbase/public_html/core/db_mysql.php
Line: 89
Function: db_debug_error




Can you make any sense of that?

Change that back. It was for sql.



Do you have a php.ini file in your root? If so, what does it contain?

Your host may have compiled PHP differently this time or added additional security such as Suhosin or suPHP



Copy the code below to a text file and save it as any filename.php and upload to your server (don’t use phpinfo.php). Send me a link to this file via PM and I’ll take a look and see if I can help you figure it out.



Also let me know if your writable directories are chmoded to 777 or 755 and if you have made any additions to your .htaccess files other than cs-cart default.



```php
phpinfo();

?> ```

[quote name=‘Texas Trophy’]Change that back. It was for sql.



Do you have a php.ini file in your root? If so, what does it contain?[/QUOTE]



Hi - unfortunately there’s no php.ini file in my root folder.



Thanks again.

Hi,



I have solved the problem and tracked it down to a piece of code I added to the init.php file.



The below piece of code “used to” put a comment tag in the code to show when a template finished and the template used - obviously causing some error with PHP 5:





```php

function show_template_end($tpl_source, &$smarty)

{

//$smarty->$_current_file;

$smarty->$_current_file;

$STRING = $tpl_source;

$STRING = $STRING . ‘’;

return $STRING;

}

*/



$smarty->register_postfilter(‘show_template_end’); ```





Incidendtly - the below piece of code still works, and can be very useful if you are designing templates. It puts a comment tag in where a template starts and the name of the template used, so you know whats going on when you view source. You put it in the the init.php file just after fn_init_templater();



I’m still unsure why my similar snippet for showing when the template ends doesn’t work in php 5, but just showing when a template starts is still very useful when designing.



```php function show_template_start($tpl_source, &$smarty)

{



$STRING = ‘’ . $tpl_source;

return $STRING;

}





$smarty->register_prefilter(‘show_template_start’);

```



Thanks for your help

Scott,

Back on the original subject of this posting, what else besides the 2 things you mentioned may result in pages not showing up after upgrading to current version of php?

in this case, it appears to be a slight code variation, how would that affect it?

There are some modules that don’t play very well with each other or with other additions such as caching applications Mike



What I was mostly interested in this case was time limits and to see whether they made a change from using PHP as a module to CGI or the reverse. If I found nothing then I would expect that an IDS was installed and it’s ruleset was blocking a required function. This was a big problem on our servers with the first 1.3.5 release. Our IDS rulesets needed adjusted greatly to keep it from blocking some aspects of the CS-Cart code. Most of the time if an Intrusion Detector blocks a request, the client will either be served a blank page or get a time out.



Our servers are running PHP 5.2.5 without problems and I don’t see an issue with the code above other than the comment closing tag on the top one that will cause a parse error.