$_SERVER['HTTP_HOST']variables将在本地和部署的环境中返回正确的主机名。 但是在客户端环境中,这个variables正在提取一些不同的主机名。 我非常确定这不是一个PHP的问题。 但是,任何人都可以给我一些指针,我缺less处理这种情况下,http主机是不同于实际的url? 有没有问题的Apacheconfiguration? 注意:我没有访问该特定的服务器。
我想要做的是通过客户端证书到我的PHP页面。 为了testing,我在Linuxterminal上使用curl : curl –cert cert.pem 'https://example.com/test.php' 在test.php ,我已经设置为打印$_SERVER超全局: <?php print_r($_SERVER); ?> 在Apache中,我有以下选项: <IfModule mod_ssl.c> <VirtualHost _default_:443> … SSLVerifyClient optional_no_ca SSLVerifyDepth 1 SSLOptions +StdEnvVars +ExportCertData … </VirtualHost> </IfModule> 在执行我的curl命令后,我看到$_SERVER['SSL_CLIENT_CERT']variables是空的: Array ( [HTTPS] => on [SSL_TLS_SNI] => example.com [SSL_SERVER_CERT] => — REDACTED — [SSL_CLIENT_CERT] => [HTTP_USER_AGENT] => curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 [HTTP_HOST] => […]
我有一些麻烦,以获得.htaccess文件的正确configuration。 我使用mvc模式制作了一个小站点,所有的url都像site.com/appname/public/index.php?param=page。 我试图让所有url写为site.com/page。 我search了Apache文档,但我仍然困惑… 这是我现在在/ public目录中的: Options -MultiViews RewriteEngine on RewriteBase /appname/public/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] 这是我在根目录中的: RewriteEngine On RewriteRule ^(.*)$ appname/public [R=301,L] 这工作正常,它redirect到index.php(在/公共目录),并重写所有url到site.com/appname/public/page。 现在我triyng得到更多,我也会隐藏/ appname /公共,但我不能undestand如何。 我应该结合更多的RewriteRule来匹配“/ appname / public”吗? 有什么build议么? 非常感谢! 编辑:关于我想要实现的更多信息。 我有一个目录树,如: htdocs |—appname | |—app | |—other_dirs | |—other_files | |—public |—some_dirs/file |— index.php 为了访问我的网页,我需要指向浏览器index.php并传递一些GET值。 […]
我们已经将我们的网站从Apache 2.4迁移到NGinx,并且从我们的Soap操作不起作用。 我们在Centos 6服务器上使用PHP 5.6,我已经安装了php_soap: yum安装php_soap php56_soap 重新启动的Nginx服务,php_fpm服务,服务器本身,validation运行时安装了php_soap: php -m | grep肥皂 结果还是一样的: 致命的错误:类'SoapClient'找不到… 有没有人有任何想法我可能做错了? 先谢谢你。
我已经看到更多的人有同样的问题,但他们的解决scheme没有为我工作。 我有centos 7 + nginx + php-fpm(版本7.1)。 当我尝试访问我的虚拟主机时,我得到“找不到文件”。 由php-fpm触发,这是我在nginx日志中看到的: 2017/02/27 11:18:54 [error] 7540#7540: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.56.1, server: site.dev, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "site.dev" php-fpm和nginx都与nginx用户一起运行 root 7539 0.0 0.0 45704 988 ? Ss 11:18 0:00 nginx: master process /usr/sbin/nginx -c […]
我在我的Webfaction网站上安装了Nextcloud,并且希望删除URL中的“ index.php ”。 我遵循这里的指示 ,但后来意识到它说: 此外,这些说明仅在将Apache与Apache的mod_php模块一起使用时才起作用。 其他模块,如php-fpm或mod_fastcgi不受支持。 看起来我的主机使用Apache和fastcgi。 但是,干净的URL可以工作 – 而不是https://example.com/index.php/apps/files/ ,我可以去https://example.com/apps/files/并获得正确的页面。 但是Nextcloud只是在我导航时插入“ index.php ”。 确切地说,303发送到长URL的redirect。 此外, 这个论坛条目build议它可以使用php7和fastcgi。 我怎样才能停止插入? 如果需要的话,我可以编辑代码,但是我的PHP使用经验来自于mysql_* API的时间,在课前,所以我很难find我的方式:-)也许有人在这里已经知道这个问题的一个快速解决。
我无法findIIS日志的非错误调用PHP文件。 我最近被授予运行php的IIS 7.5服务器的所有权。 在挖掘日志时,我找不到任何正在进行的常规php调用的logging。 以下是我提出的示例基本请求的标题 curl -v https://my.site.com/filename.php … > GET /filename.php HTTP/1.1 > Host: my.site.com > User-Agent: curl/7.47.0 > Accept: */* > < HTTP/1.1 200 OK < Content-Type: text/plain < Server: Microsoft-IIS/7.5 < X-Powered-By: PHP/5.4.45 < X-Powered-By: ASP.NET < Date: Wed, 01 Mar 2017 16:04:01 GMT < Content-Length: 92 我期望在IIS日志中的条目(简化) [时间戳] – 200 [响应时间] […]
我们有一个新的Drupal 8网站,我们无法更新一些内容。 如果主体字段包含一个或多个撇号或分号,保存内容将失败。 如果我删除这些字符,内容保存很好。 这种行为只发生在生产服务器上。 开发服务器没有问题(虽然这两个环境是不同的)。 生产服务器具有以下内容: RHEL 6 Apache 2.2.15 PHP 5.6.30 Drupal 8.2.6 当内容无法保存时,我在浏览器控制台中看到一个302的HTTP状态代码,然后redirect到该网站的主页。 当内容保存时,我看到状态码303返回,然后根据我如何到达节点编辑表单,redirect到内容概览页面或发布页面。 我没有看到有关这个日志的任何PHP错误消息。 由于它只发生在生产服务器,我怀疑这是一个服务器configuration问题。 有没有人见过这种行为,或者可以提供任何build议,如何进行?
我注意到,php-fpm的configuration文件可以selecterror_log ,但我也看到php_admin_value[error_log]使用。 有什么不同? 此外,PHP手册说log_errors标志“ 告诉脚本错误消息是否应该logging到服务器的错误日志或error_log ”,但我不知道如何解释。 log_errors = off是否意味着没有错误日志logging,或者错误将会转到apache / nginx的日志(而不是由php-fpmlogging)?
我已经configurationApache使用php-cgi ,如下所示: <Directory "c:/wamp64/cgi-bin"> AllowOverride All Options +ExecCGI AddHandler cgi-handler .php Action cgi-handler /local-bin/php-cgi.exe Require all granted </Directory> 但由于php-cgi.exe的可访问性要求有权限,所以我使用了下面的块: <Directory "c:/wamp64/bin/php7"> Require all granted </Directory> 这会造成安全问题吗? 如果是,那么解决scheme是什么?