computer cannot read php.ini

+2 Daniel Stockham · August 20, 2014
I'm seriously at my wits end here and this could be the biggest newbie question anyone could ask.

I was setting up a php file that accepted form data and placed it in a MySQL database on my machine. At first, I received a fatal error that look like this:

Call to undefined function mssql_connect()

So I knew it had to do with the extensions.

I went ahead and did some research, found out that I needed to configure several extensions on the php.ini file.

Then the nightmare started...

I found out I had to rename the php.ini-development to php.ini. Once I done this  apache could not read the php script anymore. It simply displayed the source code.

It is funny though, I can run phpinfo and run a simple php file but when I introduce variables, php just doesn't want to read it.

I tried messing the exts and libs some, changed the path through the control panel, and even reinstalled php several times.

I currently have php 5.5.5 and the most current version of Apache.

Post a Reply


Oldest  Newest  Rating
0 Daniel Stockham · August 22, 2014
I did it!

I installed WAMP and everything was running smoothly. I had a hiccup with PHPmyAdmin but I soon corrected it through the my.ini config file.

Once I built the database that I needed, I noticed the server was not reading the php code. However, after proofreading the code I written and rearranged my variables in the correct order, I was finally getting error messages which I felt good about believe it or not. It definitely told me I was getting a connection.

And after further proofreading, my database connection works!

About. Damn. Time.
0 Daniel Stockham · August 21, 2014
I originally had XAMP however, during the tutorials with Bucky he suggested to download the Apache server by itself as well as the rest of the modules.

I'll try WAMP and see if I have any luck.
0 Nikola Novakovic · August 21, 2014
Why don't you go for something like WAMP ( or MAMP if mac user ) if you already haven't ? It sets up everything for you and you can use it right away. 
0 Daniel Stockham · August 21, 2014
That was the original problem but now php cannot even process the script I have.
+1 Daniel Stockham · August 21, 2014
Let me reiterate :

I get the fatal error when I do not have the php.ini file in the folder. However once I rename it to php.ini , it doesn't even bother interpreting the php code.

It just outputs the source code, no matter what changes I make to it.
+1 Emily Cash · August 21, 2014
Try using mysqli_connect()
  • 1



Server-side, HTML embedded scripting language used to create dynamic Web pages.