Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

enable curl_exec on php.ini

Tags:

php

curl

centos

I wanna run php script which has got curl on it.

but following functions are disabled by php.ini:

exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,show_source

I have changed following line in php.ini:

disable_functions = exec,passthru,shell_exec,system,proc_open,popen,show_source

and run service httpd restart command on ssh,but when I run phpinfo() function it will show curl_exec and curl_multi_exec are disabled again.

where is the problem and how should I solve it?

like image 390
Moein Hosseini Avatar asked Jun 21 '26 03:06

Moein Hosseini


2 Answers

The command line php may be using a different ini file to the one loaded up by Apache.

you must be find which php configuration in used. you need to edit current configuration file.

$> php -i | grep "Loaded Configuration File"
Loaded Configuration File => /usr/local/lib/php.ini
$> vim /usr/local/lib/php.ini

and remove disabled function. and final step is :

/etc/init.d/httpd restart
like image 101
Vahid Chakoshy Avatar answered Jun 22 '26 18:06

Vahid Chakoshy


Go to the end of php.ini, and find the following line:

disable_functions =exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source;

Just edit it like this:

disable_functions =exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,parse_ini_file,show_source;
like image 37
Aki Avatar answered Jun 22 '26 17:06

Aki



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!