Home >Backend Development >PHP Problem >What should I do if php curl_init cannot be used?
php curl_init cannot be used to solve the problem: 1. Open the terminal command window; 2. Solve the problem of being unable to use the curl_init() function by executing the "sudo apt-get install php-curl" command.
The operating environment of this article: Ubuntu16.04 system, PHP7.4 version, Dell G3 computer.
What should I do if curl init doesn't work?
Solve the problem that PHP cannot use the curl_init() function:
Mainly aimed at building a CRMEB environment in Ubuntu16.04, and a curl_init problem will appear in the monitoring environment. At this time, you only need to execute the following command to solve the problem:
sudo apt-get install php-curl
Related introduction:
curl_init - Initialize a cURL session
Instructions
resource curl_init ([ string $url = NULL ] )
Initializes a new session and returns a cURL handle for use by the curl_setopt(), curl_exec() and curl_close() functions.
Parameters
url
If this parameter is provided, the CURLOPT_URL option will be set to this value. You can also set this value manually using the curl_setopt() function.
Return value
If successful, return a cURL handle, return FALSE on error.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What should I do if php curl_init cannot be used?. For more information, please follow other related articles on the PHP Chinese website!