Knowledge.ToString()

php.ini Changes Have No Effect

Today I tried to install PHP and MySQL on my local Windows XP Pro machine. Both were working fine individually but I could not connect to the MySQL from PHP code. I tried to change php.ini file but no matter what I do, changes were not reflected when I tried phpinfo() function.

php.ini File Location Verified

I verified that php.ini is at the correct location and I did not have any php.ini on any other location.

Every time I make changes, I was restarting the IIS Server but somehow changes were not reflected.

IIS Server Restarted – Wrong Way

When I was restarting IIS Server, these are the steps I was following.

Go to Control Panel > Administrative Tools > Internet Information Services > Expand [Computer Name] > Expand Website > Right Click on Default Website and press Stop button and again start it.

But after sometime I realized that this is NOT IIS restart. It is just Website restart.

IIS Server Restart – Correct Way

For IIS restart run the following command on Command Prompt. Make sure you open Command Prompt with “Run as administrator”.

iisreset /restart

And boom. I got my php correctly configured and now I can connect to MySQL from PHP code.

Share

Comments

2 responses to “php.ini Changes Have No Effect”

  1. Jen Avatar
    Jen

    Holy moly, i couldn’t figure it out. Then I read this. Thanks for the posting. Saved me who knows how long of scouring message boards!!

  2. Jan Nordgreen Avatar
    Jan Nordgreen

    Thanks for posting this! I had the same problem. Read your post, stopped and started the apache server, and everything worked!

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *