I have been trying to configure my Apache server all day, however I am having major issues with getting a php.ini file to be loaded.
When I try to connect to my database I get this error:
Call to undefined function mysql_connect()
After getting this error, I loaded up the php info page and relized my php.ini file was not being loaded as seen from here,
clip from my php.info page:
Configuration File (php.ini) Path C:\windows Loaded Configuration File (none) Scan this dir for additional .ini files (none) Additional .ini files parsed (none)
- I am running PHP version 5.6.21
This is on a windows machine.
Things I have done inside my php.ini file:
- have uncommented these lines:
- Changed extension to:
extension_dir = "C:\php\ext"
Have also added this to my apache config file :
LoadModule php5_module c:/php/php5apache2_4.dll AddHandler application/x-httpd-php .php # configure the path to php.ini PHPIniDir "C:/php"
my php.ini file is inside c:\php I have also tried putting it inside of Windows but Ideally I would like it in the php folder, however neither of these worked.
When I run php -m it does show both mysql and mysqli unde php modules.
I have also tried adding a php folder to my registry under HKEY_LOCAL_MACHINE\SOFTWARE (then I added \php) In which I added a string Value called IniFilePath and set the path to C:\php\php.ini (also tried just C:\php)
I did this because http://php.net/manual/en/configuration.file.php says it checks there before it checks inside the windows folder. However nothing I do seems to work.
How can I get it to load my php.ini file (ideally inside the php folder).