Solved

Website works on One server but not another

Posted on 2014-04-06
12
341 Views
Last Modified: 2014-04-26
We have a PHP based webpage that is currently running on a Windows 7 box with IIS7 Express. We need to move it to the new 2012 Server running II7.
The Webserver role and all the apps and functions are installed, as is PHP and MySQL. We have successfully moved another PHP based site to the new box and it runs without issue but the one in question will not load. When trying to browse the login page, the browser just spins on a white screen.

There are no errors popping up, nothing in the logs. Is there some sort of "gotcha" with Server 2012 or with moving a page from express to the full version of iis7? This is very frustrating! Thanks!
0
Comment
Question by:JP_TechGroup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 2
12 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39981458
PHP generally doesn't care about the version of the server, only about accessing needed resources.  Are you running the same version of PHP on both servers?  Have you moved the SQL Server and/or changed the SQL access coding?
0
 

Author Comment

by:JP_TechGroup
ID: 39981562
The MySQL database is still in the old location and the site is configured to point to it.
Same version of PHP... it is really odd. The other PHP site that does work was written by the same guy... the one that won't run is actually built on the same framework
0
 

Author Comment

by:JP_TechGroup
ID: 39981585
Turns out, I'm wrong. Neither of them work (which oddly makes me feel better)
The working site had binding information entered which directed back to the old site)
SO, slightly different question. PHP based site that simply tries to reload again and again... any ideas as to why?
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39981592
My first "guess" would be that the MySQL connection is for 'localhost' instead of the actual host.  Which means it will never connect on the new server.  Run 'phpinfo()' and see if that works to tell you what version and settings PHP is using on the new server.
0
 

Author Comment

by:JP_TechGroup
ID: 39981767
Mysql is configured to read from the remote server, firewall allows the port traffic, verified by Telnet. PHP version is the same on both boxes, 5.4 also confirmed.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39981845
Mysql is configured to read from the remote server
For that to be true, you must have a user that is allowed to connect from either 'anyhost' (%) or that specific IP address.  You can't verify that with telnet.

MySQL users are defined by username, password, and connection.  The options are 'localhost', 'anyhost' (%), or a specific host IP address.  http://dev.mysql.com/doc/refman/5.1/en/adding-users.html
0
 

Author Comment

by:JP_TechGroup
ID: 39981945
Sorry, too much information in one sentence. Was not saying I had verified MySQL connection via telnet... however, mysql connection by the logon username for the server is confirmed...
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39982116
Don't mean to be excessively picky about this but MySQL definitely is picky about it.  The correct username, password, and connection are all required.  Here is a simple logon script.  Fill in your details and run it on the new server.
<?php
// MySQLi Database Settings
// Include this at top of each php file, for central configuration.
$dbuser = 'username';
$dbpass = 'password';
$dbname = 'your-database';
$dbhost = 'MySQLHostIP-address-or-name';
// Opens a connection to a mySQL server
$link = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
if ($link->connect_errno) {
    echo "Failed to connect to MySQL: (" . $link->connect_errno . ") " . $link->connect_error;
} else echo "Connection to MySQL succeeded.";

Open in new window

0
 
LVL 1

Expert Comment

by:Nicola Mackin
ID: 39982733
Try enabling php error reporting for all errors. This will show you any error generated by your php scripts including authentication errors.

Edit your php.ini file and search for error_reporting. Set the variable to be

error_reporting = E_ALL ^ E_NOTICE ^ E_WARNING

and thenrestart your webserver.

When you try to run your website it should now display all errors. Don't forget to set this back as E_ALL is a security risk on a production site.

Regards
Nicola
0
 

Accepted Solution

by:
JP_TechGroup earned 0 total points
ID: 39988840
Hehehehe...
Found it. How stupid.
in php.ini short_open_tags was set to off.
Changed to On and viola.
0
 
LVL 1

Expert Comment

by:Nicola Mackin
ID: 39988864
Well done!
0
 

Author Closing Comment

by:JP_TechGroup
ID: 40024337
This was the reason for the error.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this Micro Tutorial viewers will learn how to use Boot Corrector from Paragon Rescue Kit Free to identify and fix the boot problems of Windows 7/8/2012R2 etc. As an example is used Windows 2012R2 which lost its active partition flag (often happen…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question