Moved my site to a new hosting company and PHP code is busted.


Hi all,

I inherited a website that allows for camp sign-ups. And let me say that I understand very little about PHP. There are 3-4 php files that are used to write the registration to a mysql db and interact with PayPal’s API and then verify payment back to the website, decrement the number of available spaces on the website and sends a confirmation email to the submitter. Everything seems to be working on the front end. Folks are able to register - the data gets captured by PayPayl and they pay this part of the PHP code is working. The remaining steps seem to be broken …

What’s not happening is that the mySQL db is not being written to with the registration information, the number of available slots is not decrementing and the confirmation email isn’t going out… all of which the code used to do.

What changed? I moved the entire website over to a new hosting company ( I also dropped it down one level into a subdir because they wanted an umbrella parent site.
Here’s the error I’m getting from the verify.php file:

Warning: fopen(./.xml) [function.fopen]: failed to open stream: No such file or directory in /home/vicky/public_html/beecave/camp_util.php on line 150 Could not open camp parameter file

Then I go to line 150 of the camp_util.php and I’m completely lost. Again, this all used to work before I moved to a new web hosting company.

149 // Open the config file and read it in
150 $fp = fopen("./$camp_xml", “r”) or exit(“Could not open camp parameter file”);
151 $data = fread($fp, filesize($camp_xml)) or exit(“Could not read camp parameter file”);

There is another file called summer_camp_2011.xml that it is supposed to read for camp dates and total capacity per camp week and I believe that is the file it says it’s not able to open, but it’s reading that file to display the sign-up page.

I know this is probably too complex to handle over a forum - just wondering (hoping) that some genius out there can shed some light. I’m happy to provide the source files if someone has some cycles.

Thanks for any help.


is the info paypal is sending back reaching you?

you mentioned that you have dropped the site down one folder level, is the paypal api still in same place or have you moved that too??
if you have moved it, did you update the change on paypal?

let us know, and we’ll investigate further if necessary,

Red :wink:


Hi there,

Firstly, it appears that the variable you are using for the filename is not working properly PHP is just seeing “./.xml” - I would assume you want an actual file name there, so you might want to check this variable is still being set properly.

Secondly, the beginning of the path is “./” which means “start from the same directory as the PHP file”, so if the PHP files moved and the xmls didn’t, you are going to need to use “…/” one or more times.


You should have chose some hosting provider that gives your free migration and is not that expensive. Like you could go with Cloudways web hosting with mysql and php support. This hosting provider offers free migration to their hosting servers from any other provider.