Solved

PHP & MySQL not working locally

Posted on 2015-02-23
6
176 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
  • 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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…
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…
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 …

863 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

19 Experts available now in Live!

Get 1:1 Help Now