• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 104
  • Last Modified:

Exporting webproject failure

Hi,

I am inheriting someone else's web project - and so that i won't be messing up the production copy, I've imported the MySQL tables and data into local host. I've also FTP the site over.

After changing the mysql globals value to reflect the new localhost admin and password, i logged into my local copy of the site.

One of the page broke - seems like every error message created for the page is thrown into the page. In the developer console, the only error message is : Failed to load resource: net::ERR_CACHE_MISS

I googled for this, but seems like people are of the opinion that the error is related to chrome, so i do not think its relevant to my problem.

My page breaks on chrome or firefox, using files and database data that i have just imported and copied over from production, which works just fine.

Is there a step that I may be missing when copying over a site? Something i may have overlooked? I know this is terribly open ended question, but I am not quite sure where to start. PHPStorm does not throw an error in the code itself, the console shows only the one error, but the whole page is throwing all sorts of php code and error messages from the code itself.

Thanks....
0
NeverEndingFlashStories
Asked:
NeverEndingFlashStories
  • 8
  • 7
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
Is this a Wordpress site?  There are a lot of things that fail on 'localhost' including cookies in Chrome.  Try running it with the IP address of your machine and/or web server.
0
 
NeverEndingFlashStoriesAuthor Commented:
No, its a normal PHP site - using some foundations 5, i believe.
My web server/mysql is installed using XAMPP
I have tried 127.0.0.1 as per your suggestion, the error persists.
I have also tried firefox.
I also believe the developer didn't use any cookies.
Any other thoughts?
0
 
NeverEndingFlashStoriesAuthor Commented:
Ok,

So, I've analyzed the developer's code, and for some reason, it looks like he has a <div> codes <div> that should be part of a different page that is in the breaking page.

The only reason I can think of , is because he may have copied the other page as a template?
Removing the whole <div> seems to fix the broken page...(not sure if it will break anything else).

Why would this be an error on my localhost, but not in the production server?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Dave BaldwinFixer of ProblemsCommented:
Not 127.0.0.1 (since that is still 'localhost') but the network IP address of the machine.  I don't even have a 'localhost' or 127.0.0.1 connection on this machine because it is very limited in it's usefulness.  The network IP address of the machine I am on is 10.20.46.40 and that's what I use to access the web server on this machine.  

I know there is a lot of sample code out there that uses 'localhost'... but it fails a lot of times also.  And there is no 'localhost' on the internet since by definition, 'localhost' is only on your machine.  'localhost' on another machine is only on that machine.

Sessions use cookies and you are most likely using PHP sessions.  If you can't use cookies then you can't use Session variables.
0
 
Dave BaldwinFixer of ProblemsCommented:
If it was just a <div> with only HTML, it wouldn't 'break' the page although it may make it look funny.
0
 
NeverEndingFlashStoriesAuthor Commented:
Hi Dave,

Sorry, i am a little bit slow - I was not a web developer til about a month ago when the three projects suddenly falls into my lap. Still learning the basics of php/html/css/mysql/javascript all at once.

That said, how do I find my network ip? I am having difficulty understanding what you mean by not using localhost. To clarify, the production page is on a completely different server. The production page did not break.
 
The localhost is on my own computer at home. This is the one that breaks.

I guess i am also not quite sure what the definition of a broken page is, i just sort of used it earlier. This is a screenshot of how the page looks like. I think its broken, but it may also just look funny...
error.png
0
 
NeverEndingFlashStoriesAuthor Commented:
PS: you are correct, he does use session variables.
0
 
NeverEndingFlashStoriesAuthor Commented:
PPS: Looking at the error screenshot i attached - in the first line - you can see that the php comments are all included. Which is a little weird, because commented out code should not be displayed like that, i think?
0
 
NeverEndingFlashStoriesAuthor Commented:
Hi,

I've figured out the issue - but not the solution, or why it has happened. When inspecting the error in my html, this is what shows up on the browser (see file attached).

Apparently, the browser adds the following to part of the block of code inside the div :

<!--?

Which comments out only part of the code. Why would it do this? I have googled around, but it doesn't seem conclusive. One responds is that my localhost server is not setup to handle php files, but i know it does, as i have another php project on the go that works. Picture of error from console
0
 
Dave BaldwinFixer of ProblemsCommented:
This <!--? is not a comment in PHP.  And it is not an opening tag for PHP either which is why the code is showing up in your browser.  

It looks like you are using Chrome to run your pages.  Are you using some development program also?

This site http://php.net/ is the reference for all PHP.  This simple PHP program will tell you everything that your installation of PHP knows about itself.  Save it to your web root directory as 'phpinfo.php' and run it in your browser.
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

Open in new window

0
 
Dave BaldwinFixer of ProblemsCommented:
What version of PHP is running on your server and what version on you local machine?
0
 
NeverEndingFlashStoriesAuthor Commented:
Hi Dave,

- The error also shows up on Firefox.
- The comment is an HTML comment right after the <div> - and it is not in the actual PHP file...it looks like it gets added later by something?
- I am using PHPStorm IDE, but the error showed up before I even do anything to the original code. The original code was written using Notepad++
- on my local machine, the PHP is running 5.5.15
- on the server, its running 5.3.3

Thoughts?
0
 
Dave BaldwinFixer of ProblemsCommented:
I suggest you use Notepad++ at least until the basic code runs.  Many IDE's add their own code to files.  I don't use any of them.  

There are differences between PHP 5.3.3 and PHP 5.5.15 and there is no easy way to tell whether they are part of your problem.  

Did the 'phpinfo.php' file run ok?

How to find your local IP address: https://kb.iu.edu/d/aapa
0
 
NeverEndingFlashStoriesAuthor Commented:
Hi Dave,

yes, the phpinfo.php file run okay. It gave me a long php info page.

Thanks for your efforts. I am finding more and more problems down the pages, seems like the original developer ignored a lot of notices, which is now showing up in my installation.
Sigh.
I may have to just do the work i need to do on the production site - otherwise i will end up having to fix up all the mess first. Which is really ideal, except my deadline does not allow me to do so.
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome.  You know you'll have to do all that eventually anyway.  Preferably before your web host moves to a newer version of PHP.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 8
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now