我的.htaccess: SetEnv tvar "my value" RewriteEngine on RewriteRule .* – [E=boostpath:normal] 我的虚拟主机设置: AllowOverride All Options FollowSymLinks Require all granted ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9001/home/dir/public_html/www.site.com/$1 我的PHP文件: <?php putenv("foo=bar"); echo "<br><br>env"; echo getenv("foo"); #works, outputs bar echo "<br><br>env2"; echo getenv("tvar"); #doesn't work, empty echo getenv("REDIRECT_tvar"); #doesn't work, empty echo "<br><br>"; echo "<br><br>env3"; echo getenv("boostpath"); #doesn't work, empty echo getenv("REDIRECT_boostpath"); […]
我把我的网站迁移到新的服务器上。 但是,我得到了显示分数的错误。 这是错误: 在旧服务器上: 我安装了相同的扩展名为PHP。 我错过了什么? 谢谢。 更新: 它与PHP中的默认字符有关。 所以我在php.ini中注释掉了,然后重新启动了Apache。 它工作完美。 default_charset =“iso-8859-1”
我刚刚搬到一个正常的经销商托pipe专用服务器托pipe,目前面临的问题与电子邮件黑名单。 我的一个客户有大约4个联系表格,当发送邮件时,它会自动发送收据邮件给用户和pipe理邮件。 我已经放置了一个validation码,以防止滥用垃圾邮件和僵尸工具,这很好。 问题是:用户input错误的电子邮件地址,导致发送无效甚至反弹 。 (网站每天的访问量约为400-800次,每天约有10-25个联系表格。) 有时它可能会变得非常糟糕(反弹和无效发送),IP被黑名单和其他电子邮件黑名单工具列入黑名单。 他们认为我们正在发送垃圾邮件。 解决这个问题的最好方法是什么? 我应该和我的客户谈谈,关掉这个function,自动发送电子邮件给客户? 还是有更好的方法来处理黑名单?
我有多个caching服务器通过Memcached :: addServers()api添加到PHP层的虚拟池中。 在容错testing期间,我注意到,使一个memcached服务器离线导致应用程序的响应时间增加到每个请求3-6秒,通常每个请求需要0.5-2秒。 根据这篇博文的build议,我已经实现了这些设置: $memcached = new Memcached(); $memcached->setOption(Memcached::OPT_CONNECT_TIMEOUT, 10); $memcached->setOption(Memcached::OPT_DISTRIBUTION, Memcached::DISTRIBUTION_CONSISTENT); $memcached->setOption(Memcached::OPT_REMOVE_FAILED_SERVERS, true); $memcached->setOption(Memcached::OPT_RETRY_TIMEOUT, 1); $memcached->addServers($servers); 但是,这些设置看起来并不能解决滞后问题。 解决问题的唯一方法是将服务器重新引入池中,然后消失。 显然这不是一个理想的解决scheme,因为解决生产问题可能需要15分钟(即可怕的上午3点)。 在研究这个问题的时候,我碰到过这个post ,里面讨论了使用moxi,听起来很有趣,但是在我介绍另外一个应用之前,我想知道别人是如何解决这些滞后问题的?
我试图在同一个站点上testingHHVM和php-fpm,同时运行这两个。 但是我希望php-fpm只能在一个目录下工作,但是我觉得我没有把它做好 location ~ \.(hh|php)$ { fastcgi_pass 127.0.0.1:9000; # or if you used a unix socket # fastcgi_pass unix:/var/run/hhvm/hhvm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location /checkout { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } 进入/结帐时,我找不到一个文件 Nginx错误: FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream […]
我安装了php55- *,因为我需要在我的应用程序中升级SDK(最终需要PHP 5.4或更高版本)。 看来, pdo_mysql.so不能被加载: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/5.5/modules/pdo_mysql.so' – /usr/lib/php/5.5/modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 我知道我的模块目录中没有pdo_mysql.so 。 我有pdo_mysqlnd.so 。 有什么不同? 我在EC2上使用Amazon Linux AMI 2014.09。 我已经安装了php55-pdo软件包,以及php55-mysqlnd软件包。
我有一个运行在2 GB RAM的centos 5上的VPS。 我在该服务器上运行IP.Board论坛。 最近我的服务器被黑了,我不得不格式化磁盘,然后重新启动。 我以前使用APCcaching,它运行良好。 但现在,当我启用它论坛脱机。 我不知道该怎么做。 请帮我把它工作。 让我知道是否需要提供更多关于我的服务器的信息。 问候 我正在使用下面的configuration,我发现StackOverflow问题: https ://stackoverflow.com/questions/3570131/optimize-apc-caching apc.enabled=1 apc.shm_segments=1 ; I would try 32M per WP install, go from there apc.shm_size=128M ; Relative to approx cached PHP files, apc.num_files_hint=512 ; Relative to approx WP size W/ APC Object Cache Backend, apc.user_entries_hint=4096 apc.ttl=7200 apc.use_request_time=1 apc.user_ttl=7200 apc.gc_ttl=3600 apc.cache_by_default=1 apc.filters […]
我无法从我的自定义位置运行一个PHP: $ cat /etc/apache2/sites-available/000-default.conf <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /home/alex/Documents/var_www_html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet $ ls -l ~/Documents/var_www_html total 52 drwxr-xr-x 2 alex alex 4096 Oct 25 16:37 dir1 drwxr-xr-x 2 alex alex 4096 Oct 25 16:37 dir2 -rwxr-xr-x 1 alex alex 493 Oct 25 […]
我正在构build一个基于SAML的联邦身份validation机制,其中IdP是ADFS 2.0,SP是在Linux上运行的Shibboleth。 我能够做到以下几点: 尝试访问受保护的页面,该页面将我redirect到IdPlogin页面。 通过IdPlogin页面login并返回到受保护的页面。 浏览到spserver.internal / Shibboleth.sso / Session并查看返回的属性,包括eppn。 但是,我无法在PHP中以REMOTE_USER标头的forms提取eppn属性。 我已经禁用了attribute-policy.xml(注释在shibboleth2.xml中)。 我错过了一些微不足道的东西,我怀疑对于我的世界我不知道是什么。 要么PHP没有selectShibboleth设置的服务器variables,要么Shibboleth永远不会设置它们。 有任何想法吗? 从spserver.internal / Shibboleth.sso / Session输出 Miscellaneous Session Expiration (barring inactivity): 479 minute(s) Client Address: abcd SSO Protocol: urn:oasis:names:tc:SAML:2.0:protocol Identity Provider: http://veragence.thesixthflag.com/adfs/services/trust Authentication Time: 2014-10-28T11:55:23.947Z Authentication Context Class: urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport Authentication Context Decl: (none) Attributes eppn: [email protected] 来自shibboleth2.xml的相关行: <ApplicationDefaults entityID="https://spURL/shibboleth" REMOTE_USER="eppn persistent-id […]
我一直在使用APC进行对象caching,并使用PHP / Apache设置一年左右,并且一直在工作。 最近我一直在玩HHVM和Nginx,并安装了APC。 它似乎正在工作,因为它看起来像DB查询被caching在内存中,但是当看着APC的统计看起来不像是在工作。 你可以在这里看到统计: http://128.199.50.72/apc.php : http://128.199.50.72/apc.php 这是一个WordPress站点,我正在使用APC下载WordPress: https : //wordpress.org/plugins/apc/ 我可以提供更多的细节,如果需要的话,但我很不熟悉的服务器configuration,所以不知道什么额外的提供。 我想另一个说明是,我一直在使用APC 3.1.13,但新的服务器使用APC 4.0.2,我不知道这是否是一个问题。 编辑 – 我使用旧版本的caching信息页面(我从我的服务器使用APC 3.1.13),现在我已经添加了新的caching信息页面,实际上是说caching没有运行。 另外的问题 – 当3.1.13是我能find的最新版本时,它是如何得到APC 4.0.2的版本的?