Inconsistencies between local XAMPP and Internet

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Inconsistencies between local XAMPP and Internet

Postby mitty » 15. August 2011 22:17

I'm new to the forums. Hey everyone :)

I'm also a relatively new developer, so can someone explain to me why when I run PHP code through the localhost, it can end up different than when I run the same code online? I beleive it has something to do with the SESSION variable and the session_start() method. When I am running code locally, everything seems to work fine, but online I am having problems where all of the AJAX divs have an error like "session_start() must be called at the beginning of the page".

For all the AJAX divs, I must include session_start(), so I use a require_once 'system_start.php'; and in that file I have the call to system_start(). It seems to me that this should just call system_start() at the top of the first page initially, then never call it again since it is only called using a require_once, but this isn't the case... It is different when posted on the web than running from localhost.

Thanks for the insight.
mitty
 
Posts: 1
Joined: 15. August 2011 22:11

Re: Inconsistencies between local XAMPP and Internet

Postby Sharley » 16. August 2011 01:46

Possible and most likely cause is different PHP versions between XAMPP and your online hosting service provider - check the versions.

The component versions of XAMPP can be found in the \xampp\readme_en.txt file.

If, as you say XAMPP is working as it should then you would need to ask your online hosting service provider this question.

To be compatible with your online hosting service provider you may need to install and work with an older version of XAMPP that contains the same version of PHP as your online hosting service provider.

Or it may be possible that your online hosting service provider can provide you with a php.ini file to a more recent PHP version (php5.ini for example) so you cam place it in the web root of your web site.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 122 guests

cron