XAMPP seems to cache my PHP files

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

XAMPP seems to cache my PHP files

Postby bbcda » 31. December 2008 16:01

Dear all!

It is a frustrating problem I have, so close before the end of the year :-) Would be nice if someone could give me a hint - I believe this must be very simple to solve:
I am developing a web application in PHP that uses a MySQL database; I work both on a Windows notebook as well as my Mac with XAMPP.

I just migrated my project to the Mac, where XAMPP makes several problems; my biggest problem is the following (and this is my question):
I put all connection parameters for the MySQL-database (such as the server name, the user, password, database name) into PHP string variables in a single PHP-file that I include in all pages where it is needed; for several reasons, I could not upload my sql-file with PHPMyAdmin (which otherwise works), so I decided to create a new database on the Mac; I then adjusted the MySQL settings in the setup.php to the new values. However, the problem is that each time I reload my application, PHP still uses the old values (for user, password etc), and thus fails to connect to the database. Even copying the whole PHP-application folder inside the htdocs-folder of XAMPP didn't resolve the problem - and I am absolutely sure that everything should work!!!

So, my question: is it possible that XAMPP on the Mac caches the PHP-files, so that it still has the old values in its memory??? I did everything I could think of to prevent it (I restarted XAMPP, restarted the Mac - even used different browsers in my despair, although the PHP script should not be handed to the browser, not to speak of being cached there...).

I am getting desperate... :-D Would be very nice if someone could give me a hint on where the problem may be - hopefully, then the next year can begin succesfully!

Thanks for any hints! Have a nice new year's eve!
Björn
bbcda
 
Posts: 2
Joined: 31. December 2008 15:03

Re: XAMPP seems to cache my PHP files

Postby Nobbie » 01. January 2009 16:13

>So, my question: is it possible that XAMPP on the Mac caches the PHP-files, so that it still has the old values in its memory?

No.

But maybe the software you installed has kind of caching (many forum scripts and template systems have kind of own cache), which causes that problem. As I dont know anything about your software, I cannot give more advice.

Or, maybe the wrong "setup.php" (or whatever the filename is) is included (an old one with wrong settings). You should insert some echo statements to proof that the correct files are included.
Nobbie
 
Posts: 8772
Joined: 09. March 2008 13:04

Re: XAMPP seems to cache my PHP files

Postby bbcda » 01. January 2009 17:06

Hi, Nobbie!

Thanks for Your reply! Happy new year - by the way! :-)
In fact, the PHP-software I use is a self-written software; I don't understand what You meant with caching by scripts themselves - but I believe You mean that the script itself has a functionality that stores the outcome of some subscripts temporarily to prevent them to be called to often; my program does not have such a function...

However, the other advice You gave later was a good idea - I should have come to the idea myself: I added an "echo" command to the "setup.php" that sets the database variables - and in fact You were right: the new "setup.php" is in fact read correctly - so caching seems not to be the problem... at the moment, it seems that I have made a mistake somewhere in my scripts (one subscript seems to still have the "old" version which does not make use of the data in "setp.php")...

So - thanks, it seems I have to think into another direction! :-)

With kind regards,
Björn
bbcda
 
Posts: 2
Joined: 31. December 2008 15:03


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 4 guests