Solved

PHP & MySQL not working locally

Posted on 2015-02-23
6
187 Views
Last Modified: 2015-02-23
I am running a PHP & MySQL website. I have it setup in my production server (IIS) and works just fine:

http://www.wiredinwellness.net/

If I enter incorrect password it redirects to the same page (login.php) and shows the error message, if its the correct password it redirects to the secured portion of the site.

But In my development environment its not working. I am running it on a MAC computer using MAMP, everything seems to be setup properly, the login page actually comes up just fine, but whether I enter the correct or incorrect user/password it reloads login.php but NOTHING is displayed, a blank page comes up, no errors.

is there a way to debug or find what may be wrong in my configuration that locally the page is not submitting properly or maybe the redirect is the issue ?  not sure. Locally doesn't work, when uploaded to the remote server works just fine. so the PHP code is just fine, has to be some configuration on the my local server for sure.

I am new to this environment (MAMP/PHP/MySQL) so I am not sure to even where to look.

Help is appreciated.
0
Comment
Question by:amucinobluedot
[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
  • 4
6 Comments
 

Author Comment

by:amucinobluedot
ID: 40626052
php.ini has display_errors = On

Still nothing is displayed on the browser (Chrome)
0
 

Author Comment

by:amucinobluedot
ID: 40626055
I also checked with Firefox and I have the same result, page goes blank when submitted.
0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 40626429
Try checking your Apache error logs. I don't use Macs but apparently you'll find it here:

/var/log/apache2/error_log

Also, turning on display_errors may not be enough. Add this to the very top of your pages:

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

And take a note of what the docs says:

Although display_errors may be set at runtime (with ini_set()), it won't have any effect if the script has fatal errors. This is because the desired runtime action does not get executed.
0
Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 5

Expert Comment

by:Marlon
ID: 40626687
It sounds like you have two environments; a production env and a dev env. Each has it's own server.
Could your login.php be trying to talk to the wrong server ?
0
 

Author Comment

by:amucinobluedot
ID: 40626726
No sir. Each one is talking to its own database. The servers are not connected in any way. Production works fine, hence the PHP code must be correct. But in my local environment for developing displays a blank page. Has to be something in my local setup causing this.

Ill try adding the code for displaying the error see what I come up with.
0
 

Author Comment

by:amucinobluedot
ID: 40626806
It is now showing the errors. I will try to debug and come back if after cleaning them up still can't move fwd. thanks.
0

Featured Post

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help installing Laravel app on MAMP on MAC 7 56
How to close my php post page. 3 41
Position image fpdf 4 17
Last 4 numbers of a variable 9 20
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

732 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