?
Solved

Website works on One server but not another

Posted on 2014-04-06
12
Medium Priority
?
349 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 84

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
Independent Software Vendors: 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!

 
LVL 84

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 84

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 84

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A procedure for exporting installed hotfix details of remote computers using powershell
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

752 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