Solved

PHP & MySQL not working locally

Posted on 2015-02-23
6
179 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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

813 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

11 Experts available now in Live!

Get 1:1 Help Now