我正在检查我的PHP版本使用
php -v
在控制台中命令,我在下面收到警告
PHP警告:PHP启动:无法加载动态库'/usr/lib/php/20151012/php_mbstring.dll' - /usr/lib/php/20151012/php_mbstring.dll:无法打开共享对象文件:没有这样的文件或目录in the Unknown on line 0 PHP 7.0.4-7ubuntu2(cli)(NTS)Copyright(c)1997-2016 PHP Group Zend Engine v3.0.0,Copyright(c)1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev ,版权所有(c)1999-2016,作者:Zend Technologies
我在/etc/php/7.0/fpm/php.ini文件中取消注释了此行extension = php_mbstring.dll,这似乎无法解决我的问题.我怎么能摆脱这个警告?
我尝试使用 Laravel 将 XML 空缺职位发送到 Web 服务,但我正在努力弄清楚如何连接到 Web 服务、授权和发送所需的数据。
我尝试过使用curl,但我得到了
错误:“” - 代码:0
下面是我的代码
$result // IS MY XML file
$username = 'username'
$password = 'password'
$URL = 'http://xxxxxx.com;
//setting the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,"xmlRequest=" . $result);
curl_setopt($ch, CURLOPT_ENCODING, 'UTF-8');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_exec($ch);
if(!curl_exec($ch)){
die('Error: "' . curl_error($ch) . '" - Code: ' …Run Code Online (Sandbox Code Playgroud)