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
+8.6k Golang : How to check if a website is served via HTTPS
+17.7k Golang : Read input from console line
+16.4k Convert JSON to CSV in Golang
+6.4k Golang : Example of how to detect which type of script a word belongs to
+5k Golang : Detect variable or constant type
+7.7k Golang : Find network service name from given port and protocol
+8.9k Golang : Print how to use flag for your application example
+6.3k Android Studio : AlertDialog to get user attention example
+18.5k Golang : How to count the number of repeated characters in a string?
+22.6k Golang : Upload to S3 with official aws-sdk-go package