搜索结果
查询Tags标签: errorno,共有 3条记录-
PHP用CURL发送Content-type为application/json的POST请求方法
php curl发送json postfunction json_post($url, $data = NULL){$curl = curl_init();curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);if(!$data){return data is null;}i…
2022/4/24 14:12:42 人评论 次浏览 -
连接MySQL失败,errorNo=2002,Can't connect to local MySQL server through socket '/var/run/mysqld
问题: 在本地使用mysql -uroot -p可以登录mysql 代码运行mysql_real_connect函数,失败返回errorNo=2002(Cant connect to local MySQL server through socket /var/run/mysqld/mysqld.sock (2)) 代码参数为localhost,根据返回错误,可知socket连接失败,排查连接失败的…
2022/4/12 19:12:37 人评论 次浏览 -
PHP用CURL发送Content-type为application/json的POST请求方法
php 发送json postfunction json_post($url, $data = NULL){$curl = curl_init();curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);if(!$data){return data is null;}if(is…
2021/7/1 20:25:27 人评论 次浏览