Erhan Atalar

Sistem ve Yazılım hakkında kısa notlar

Sunucu üzerinde

find / -name 'curl.so'

Komutu ile curl.so extension u bulunur ve /etc/php5/cli/php.ini içerisinde extension tanımlanır.

 

 

ssh to your server and cd to /

find / -name 'curl.so'

Run the above find command to locate where the curl binary is hanging out at. If you can’t find the file, you might need to install curl and run the find command again.

apt-get install php5-curl

You’ll now want to edit the php.ini being used for php files run from the cli (it’s different than the one used by apache), and is likely at /etc/php5/cli/php.ini

nano /etc/php5/cli/php.ini

You can also run

php -i | grep 'php.ini'

To get the file path, just to be sure.

In your php.ini file search for [curl] by pressing ctrl + w

You’ll now want to add the extension to the file and it should look something like the following, though your path to the curl.so file and such might be a little different:

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =
extension=/usr/lib/php5/20131226/curl.so

After doing the above, I was able to use curl in php scripts run from the cli.

Genel