Today working with php on windows, I experienced this error Error: Call to undefined function curl_init(). On reading around I discovered that I had to edit the php.ini file. In the C:\xampp\php directory. I didn't quite find the file but instead php-ini-development and php-ini-production so I edited both. Still got the same error.
So I decided to check the actual php.ini file using php -i command and below is what I get. It seems there isn't one. Any solutions?
Configuration File (php.ini) Path =>
Loaded Configuration File => (none)
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
Related
First of all, please forgive me for my poor English skills.
After installing the compilation of Apache, php5.3 on CenOs 7,
we have a problem with the path to set up php.ini
First of all, look at the setting value here.
Shell
PHP -r "phpinfo();"
Configuration File (php.ini) Path: /usr/local/php53/etc/php.ini
Loaded Configuration File: (none)
Scan for additional .ini files in: /usr/local/php53/etc/php.d
Additional .ini files parsed: (none)
Web
<? phpinfo(); ?>
Configuration File (php.ini) Path
/usr/local/php53/lib
Loaded Configuration File
(none)
Scan this dir for additional .ini files
/usr/local/php53/etc/php.d
Additional .ini files parsed
(none)
Found the php ini-production file in the source file.
Changed the asp_tag value in the php.ini file to On.
By changing the name to php ini.
Move to
/usr/local/php53/lib/php.ini
path
I started the Apache again, but the settings haven't changed.
I want to know how to change php.ini
Please reply.
Thank you for reading.
I have done this before so I'm not sure why it's not working, but I am trying to create a custom php.ini file and I have placed this within a specific directory.
For example, the default php.ini is located at:
C:\xampp\php\php.ini
My custom one is located at:
D:\Codebase\Somedir\123\php.ini
I placed a PHP file inside the above directory and did output with phpinfo() and it still reports it as using C:\xampp\php\php.ini.
I have restarted Apache as well.
What am I doing wrong here!?
You can see which php.ini file is loaded running php.exe --ini. On my computer it output:
Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File: C:\tools\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
If it is the wrong php.ini there, have a look to http://php.net/configuration.file
If you're using XAMPP you can change the configuration file it loads PHP with by opening the properties.ini file in the
C:\xamp
directory and editing the php_configuration_directory field to
D:\Codebase\Somedir\123\
Then restart apache for the changes to take effect.
If PHP is running as an apache module you could also edit httpd.conf on your apache setup and add this variable:
PHPIniDir "D:\Codebase\Somedir\123\"
We have a client with php v5.5.12 installed and we are trying to find the php.ini file that is being used when this is run from the command line (php-win.exe)
Running
php-win.exe --ini
returns nothing.
This is the top content of the output of phpinfo();
Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => (none)
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20121113
I've never seen this before! There are lots of modules enabled (but not all of them, which is what we are trying to fix) but can't find the config file that is being used.
Any ideas?
It was in C:\Windows. Strange it implies no .ini file was being loaded from there; and nothing in phpinfo();
I am running wamp 2.5
when i run phpinfo I get
Configuration File (php.ini) Path
C:\Windows
Loaded Configuration File
C:\wamp\bin\apache\apache2.4.9\bin\php.ini
When I go to
C:\wamp\bin\apache\apache2.4.9\bin\php.ini
it is a symbolic link to
C:\wamp\bin\php\php5.5.12\phpForApache.ini
I have this line of code in my php file :
require_once 'HTTP/Request2.php';
I have installed pear and the installation was successful and I have Request2.php file on my HTTP directory of pear on my wamp. I have put my php file on my www folder but when I run it I still get this message :
Warning: require_once(HTTP/Request2.php): failed to open stream: No
such file or directory in C:\wamp\www\php\phptest.php on line 3
I don't get why I still get this error , is there a mistake in addressing the file or something else. I'll appreciate if someone can help me with this.
thanks very much
If you are running a script out of C:\wamp\www\php\phptest.php then I am assuming you are using the CLI i.e. running a script from the command line.
The CLI gets its php.ini file from c:\wamp\bin\php\php5.5.12\php.ini i.e. not the same php.ini file that is edited when you use the wampmanager menu system to edit php.ini
Make the change to your include_path in c:\wamp\bin\php\php5.5.12\php.ini and see if that solves your problems.
You can ask PHP where it is looking for its ini file by doing this:-
C:\>d:\wamp\bin\php\php5.5.12\php --ini
Which should show something like this
Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File: C:\wamp\bin\php\php5.5.12\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
P.S. Dont be tempted to put a php.ini file in the C:\Windows folder.
I have read this post
and it didn't really help.
My php.ini file (http://www.edisk.cz/stahni/09234/php.ini_69.47KB.html) contains the correct path of ext directory.
While my ext directory contains a php_mysql.dll and php_mysqli.dll libraries, there's not a word of that in my phpinfo.
Is there a way to make it right?
http://prntscr.com/3707m
This is my error produced by php.exe.
You most likely have two separate php.ini files - one for your web server, one for the command line interface.
Make sure you're editing the correct file; Run:
php.exe --ini
which will give you output similar to the one below:
C:\>php --ini
Configuration File (php.ini) Path: C:\Windows
Loaded Configuration File: C:\Path\To\Your\php\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)
Now, edit the php.ini file and make sure that not only the following lines are un-commented:
extension=php_mysql.dll
extension=php_mysqli.dll
but also this one (which, according to the file you've posted, you have commented out at the moment):
; extension_dir = "ext"
The above one should be configured to point to your ext directory, where the php_mysql.dll file is stored. Like this (remember about double quotes):
extension_dir="C:\Path\To\Your\php\ext"
Hope this helps.