我花了三个小时,但没有找到任何东西; 我无法连接到启用SSL的服务器.我想列出我的所作所为:
首先检查我的PHP扩展目录是否正常; 扩展名不存在,php_openssl.dll
然后我打开我的php.ini文件,但我看不到任何extension = php_openssl.dll行要取消注释.
此外,我在Google上搜索并看到有同样问题的人. http://www.apachefriends.org/f/viewtopic.php?p=162623
不过,我也有
OPENSSL_CONF C:/xampp/apache/bin/openssl.cnf
...
openssl
OpenSSL support enabled
OpenSSL Library Version OpenSSL 0.9.8l 5 Nov 2009
OpenSSL Header Version OpenSSL 0.9.8l 5 Nov 2009
Run Code Online (Sandbox Code Playgroud)
没有线.我该怎么办?请分享您的建议.
我正在变得绝望,我想要的只是简单的错误处理,当PHP SOAP Web服务关闭以回显错误消息登录服务时.请帮我!
目前它仍然显示错误(以及警告......):
Fatal error: SOAP-ERROR: Parsing WSDL
这是脚本:
<?php
session_start();
$login="0000000000000nhfidsj"; //It is like this for testing, It will be changed to a GET
$username = substr($login,0,13); //as password is always 13 char long
//(the validation is done int he javascript)
$password = substr($login,13);
try
{
ini_set('default_socket_timeout', 5); //So time out is 5 seconds
$client = new SoapClient("http://192.168.0.142:8080/services/Logon?wsdl"); //locally hosted
$array = $client->login(array('username'=>$username,
'password'=>$password));
$result = $array->return;
}catch(SoapFault $client){
$result = "0";
}
if($result == "true")//as …Run Code Online (Sandbox Code Playgroud) 我想监视一些外部图像的加载频率.所以我的想法不是像这样直接给出一个uri:
www.site.com/image1.jpg
Run Code Online (Sandbox Code Playgroud)
我可以创建一个读取图像的PHP脚本,所以我构建了一个PHP文件,我的HTML看起来像这样:
<img src="www.site.com/serveImage.php?img=image1.jpg">
Run Code Online (Sandbox Code Playgroud)
但我不知道如何从磁盘读取图像并将其返回.我会返回一个字节数组还是设置内容类型?
亲切的问候,米歇尔
我正在尝试连接到安装了WAMP x64的Dropbox API.
这是我从Dropbox php API获得的Dropbox身份验证文件的例外
致命错误:未捕获异常'Exception',消息'Dropbox SDK使用64位整数,但看起来我们正在运行不支持64位整数的PHP版本(PHP_INT_MAX = 2147483647).库:C:\ Users\Albert\Desktop\www\test\dropbox-sdk\Dropbox\RequestUtil.php中的"C:\ Users\Albert\Desktop\www\test\dropbox -sdk\Dropbox\RequestUtil.php"'在第15行
它说,我检查了我的PHP版本
架构x64
我应该怎么做才能使我的Dropbox应用程序工作?非常感谢.
以下代码用于将应用程序区域设置更改为西班牙语在某些设备中正常工作,但在某些设备中,它正在放大(缩放)应用程序中的视图.有人有解决方案吗?
Configuration config = getResources().getConfiguration();
// change this to a different Locale than your device
Locale locale = new Locale("es", "es_ES");
config.locale = locale;
Locale.setDefault(locale);
getBaseContext().getResources().updateConfiguration(config, getResources().getDisplayMetrics());
Log.i("onSelected..", Locale.getDefault().getCountry());
startActivity(new Intent(getApplicationContext(), HomePage.class));
finish();
Run Code Online (Sandbox Code Playgroud) 我正在使用基于Zend Framework 3.0的CMS来管理带有Doctrine的DB I. 使用composer管理包时我的问题是什么?最近,我将所有软件包更新到最新版本并将其发送到服务器,其他文件中没有更改.更新后,我的网站显示以下错误:
致命错误:未捕获TypeError:Doctrine\Common\Annotations\AnnotationRegistry :: registerLoader()的返回值必须是Doctrine\Common\Annotations\void的实例,无法在/ home/platne/serwer18346/vendor/doctrine/annotations /中返回lib/Doctrine/Common/Annotations/AnnotationRegistry.php:117堆栈跟踪:#0 /home/platne/serwer18346/vendor/doctrine/doctrine-module/src/DoctrineModule/Module.php(57):Doctrine\Common\Annotations\AnnotationRegistry :: registerLoader(Object(Closure))#1 /home/platne/serwer18346/vendor/zendframework/zend-modulemanager/src/Listener/InitTrigger.php(33):DoctrineModule\Module-> init(Object(Zend\ModuleManager)\ModuleManager))#2 /home/platne/serwer18346/vendor/zendframework/zend-eventmanager/src/EventManager.php(322):Zend\ModuleManager\Listener\InitTrigger - > __ invoke(Object(Zend\ModuleManager\ModuleEvent)) #3 /home/platne/serwer18346/vendor/zendframework/zend-eventmanager/src/EventManager.php(171):Zend\EventManager\EventManager-> triggerListeners(Object(Zend\M)oduleManager\ModuleEvent))#4/home/p in /home/platne/serwer18346/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry.php on 117
如果需要,有些应用程序的代码:
模块:
return [
'Zend\Router',
'Zend\Validator',
'DoctrineModule',
'DoctrineORMModule',
'Core',
];
Run Code Online (Sandbox Code Playgroud)
development.local(开发者模式处于活动状态):
'doctrine' => [
'connection' => [
'orm_default' => [
'driverClass' => Doctrine\DBAL\Driver\PDOMySql\Driver::class,
'params' => [
'host' => '******',
'user' => '*******',
'password' => '******',
'dbname' => '*******',
'charset' => 'utf8'
]
]
]
]
Run Code Online (Sandbox Code Playgroud)
module.config:
'doctrine' => [
'driver' => [
__NAMESPACE__ …Run Code Online (Sandbox Code Playgroud) 我无法在PHP中创建加密的SOAP请求.根据文档,我将每个请求加密到支付网关.我生成了一个CSR并将其发送给证书颁发机构.他们向我发回了域名证书和CA证书.最大的问题是文档不适用于PHP.根据文件:
Web服务受WS-Security Sign和加密策略保护
经过很长一段时间的搜索,我发现了一个来自Git的帮助类,但每当我尝试连接时,都会出现以下错误:
一般安全错误(未找到解密证书(KeyId))
FaultCode: wsse:InvalidSecurity
我尝试按如下方式设置SSL标头:
$contextOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'cafile' => '../../certs/CA.cer',
'local_cert' => '../../certs/server.cer',
'local_pk' => '../../certs/private_key.key',
'verify_depth' => 0,
'allow_self_signed'=>true,
)
);
$sslContext = stream_context_create($contextOptions);
Run Code Online (Sandbox Code Playgroud)
更新
我将键定义为:
define('PRIVATE_KEY', 'server_prvate_key.key');
define('CERT_FILE', 'domain_cert.cer');
define('SERVICE_CERT', 'CA.cer');
Run Code Online (Sandbox Code Playgroud)
这个定义有什么问题(请参阅上面的GIT链接)?
在过去的几天里,我一直在努力将Java代码迁移到Golang,现在我陷入困境.这是可用的Java代码:
final Key k = new SecretKeySpec(keyString.getBytes(), "AES");
Cipher c = Cipher.getInstance("AES");
c.init(Cipher.DECRYPT_MODE, k);
final InputStream in = new BufferedInputStream(new FileInputStream(fileNameToDecrypt));
final CipherInputStream instream = new CipherInputStream(in, c);
if (instream.read() != 'B') {
System.out.println("Error");
}
if (instream.read() != 'Z') {
System.out.println("Error");
}
final CBZip2InputStream zip = new CBZip2InputStream(instream);
Run Code Online (Sandbox Code Playgroud)
我在Golang中的实现:
c, _ := aes.NewCipher([]byte(keyString))
// IV must be defined in golang
iv := []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
d := …Run Code Online (Sandbox Code Playgroud) 这是我的 docker-compose.yml
nginx:
build: ./nginx/
ports:
- 80:80
links:
- php
volumes_from:
- app
php:
image: php:7.0-fpm
expose:
- 9000
volumes_from:
- app
links:
- elastic
app:
image: php:7.0-fpm
volumes:
- .:/var/www/html
command: "true"
elastic:
image: elasticsearch:2.3
volumes:
- ./elasticsearch/data:/usr/share/elasticsearch/data
- ./elasticsearch/logs:/usr/share/elasticsearch/logs
expose:
- "9200"
ports:
- "9200:9200"
Run Code Online (Sandbox Code Playgroud)
当我尝试访问Elasticsearch时,localhost:9200它会起作用.
但是当我尝试使用PHP创建索引时,我收到以下错误:
致命错误:未捕获Elasticsearch\Common\Exceptions\NoNodesAvailableException:未在群集中找到活动节点
这是客户端代码:
<?php
namespace App\Elasticsearch;
use Elasticsearch\ClientBuilder;
class Client
{
public static function getClient()
{
return ClientBuilder::create()
->build();
}
}
Run Code Online (Sandbox Code Playgroud)
用于实例化Elasticsearch对象的代码:
<?php
require 'vendor/autoload.php';
use App\Elasticsearch\Client;
use App\Elasticsearch\Indices\UserIndex; …Run Code Online (Sandbox Code Playgroud) 我正在编写PHP日志文件类,但我想在写入文件的行中添加颜色.
我遇到的问题是颜色也改变了终端的颜色,我想要实现的只是改变写入日志文件的行的颜色.
class logClass extends Singleton {
private function checkDate() {
return date("onSj");
}
public function logNotice($str) {
$this->write($str, "\033[33m");
}
public function write($string, $color) {
$fileName = $this->checkDate();
$handle = fopen('error.log', 'a');
fwrite($handle, "$color" . date("Y-m-d H:i:s") . $string . "\n");
fclose($handle);
}
}
Run Code Online (Sandbox Code Playgroud) php ×8
java ×2
soap ×2
aes ×1
android ×1
bzip2 ×1
docker ×1
doctrine-orm ×1
dropbox-api ×1
dropbox-php ×1
encryption ×1
go ×1
linux ×1
locale ×1
logging ×1
shell ×1
ssl ×1
wamp ×1
wampserver ×1
wss ×1
xampp ×1