Solved

PHP & MySQL not working locally

Posted on 2015-02-23
6
173 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
Comment Utility
php.ini has display_errors = On

Still nothing is displayed on the browser (Chrome)
0
 

Author Comment

by:amucinobluedot
Comment Utility
I also checked with Firefox and I have the same result, page goes blank when submitted.
0
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 total points
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Expert Comment

by:Marlon
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

762 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

8 Experts available now in Live!

Get 1:1 Help Now