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.7k Golang : Sort lines of text example
+19k Golang : Delete item from slice based on index/key position
+6.9k Golang : Use modern ciphers only in secure connection
+11.7k Golang : Determine if time variables have same calendar day
+13.1k Golang : Verify token from Google Authenticator App
+12k Golang : Print UTF-8 fonts on image example
+15.7k Golang : Read large file with bufio.Scanner cause token too long error
+27.7k Golang : Move file to another directory
+15.3k Chrome : ERR_INSECURE_RESPONSE and allow Chrome browser to load insecure content
+13.2k Golang : Increment string example
+13k Golang : Linear algebra and matrix calculation example
+7.4k Gogland : Where to put source code files in package directory for rookie