Solved

Website works on One server but not another

Posted on 2014-04-06
12
337 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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 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 …

828 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