Solved

Website works on One server but not another

Posted on 2014-04-06
12
330 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
  • 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
 
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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
Resolve DNS query failed errors for Exchange
In this Micro Tutorial viewers will learn how to use Windows Server Backup to create full image of their system. Tutorial shows how to install Windows Server Backup Feature on Windows 2012R2 and how to configure scheduled Bare Metal Recovery backup.…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now