PHP : Fix Call to undefined function curl_init() error
Problem:
Some PHP libraries or packages depend on your server having curl
program installed. Missing curl
or the PHP to curl bridge can cause problem during development or deployment phase.
For example, you are developing your PHP program and you encounter the following error message during test phase:
An uncaught Exception was encountered
Type: Error
Message: Call to undefined function curl_init()
How to fix this problem?
Solution:
The server is missing php-curl
or php7-curl
package. Install them by
For Cent OS:
sudo yum install php5-curl
or sudo yum install php7-curl
and
sudo yum install curl
For Ubuntu:
sudo apt-get install php5-curl
or sudo apt-get install php7-curl
and
sudo apt-get install curl
See also : Fix "Failed to start php5-fpm.service: Unit php5-fpm.service is masked."
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+7k Golang : Squaring elements in array
+13.6k Generate salted password with OpenSSL example
+5.9k Golang : Experimenting with the Rejang script
+9.8k Golang : Translate language with language package example
+9.5k Golang : Sort and reverse sort a slice of floats
+15.8k Golang : Update database with GORM example
+12.3k Golang : "https://" not allowed in import path
+10.1k Golang : Random Rune generator
+11k Golang : Fix - does not implement sort.Interface (missing Len method)
+7.1k Golang : Of hash table and hash map
+16.4k Golang : Merge video(OpenCV) and audio(PortAudio) into a mp4 file
+9.3k Golang : Detect Pascal, Kebab, Screaming Snake and Camel cases