Articles of PHP

托pipe多个网站(Apache虚拟主机),Postfix设置从这些域发送邮件?

我不确定这是否是正确的解决scheme,但是我的Postfix已经在使用G-Suite的Ubuntu VPS上运行了 relayhost = [smtp.gmail.com]:587 邮件交付很好,但是,所有的邮件都是以“[email protected]”的forms发送的。我为不同的人提供了15个不同的网站,并且不会有他们的联系方式,用户注册等等。 @ me.com”。 例如; <?php define('admin_email','[email protected]'); define('website_name','client-business-name'); define('website_url', 'http://'.$_SERVER['HTTP_HOST']); define('EMAIL_FROM', 'noreply@'.$_SERVER['HTTP_HOST']); 提交这些表单仍然会导致电子邮件显示为从“[email protected]”发送 我也尝试在单个VirtualHost文件中使用这个片段,但没有运气。 php_admin_value sendmail_path "/usr/sbin/sendmail -t -i [email protected]" 我发现这些问题的代码: configuration每个域的PHP邮件() , Apache,虚拟主机和sendmail的默认发件人 在命令行中使用“sendmail”并更改“From:”地址也不起作用。 我所要做的就是能够使用From和Reply-To中input的电子邮件,而不是“[email protected]”。 任何有识之士将不胜感激。

NGINX在PHP 5.6上给Centos 7带来了错误

我试过在互联网上的所有东西,让PHP 5.6在NGINX上工作在Centos 7上。 我不想PHP 5.4(这工作),因为它是过时的地狱。 目前,当我访问我的网站上的一个php页面(502坏门道)时,NGINX给了我下面的错误: * 5连接()失败(111:连接被拒绝),同时连接到上游 我非常渴望帮助和解释。 我在/etc/php-fpm.d中获得了以下设置: listen = 127.0.0.1:9000 user = nginx group = nginx 我有这个在php.ini中设置: cgi.fix_pathinfo=0 这是我对NGINX的configuration: user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic. include /usr/share/nginx/modules/*.conf; events { worker_connections 1024; } http { include blacklisted_ips.conf; include cloudflare_settings.conf; log_format main '$remote_addr – $remote_user [$time_local] […]

错误的PHP白色屏幕

每当PHP应用程序发生错误时,我都会看到白屏。 我检查了php.ini和error_reporting = E_ALL和display_errors =我也检查了php_info()函数和error_reporting设置为6135这是正确的。 我已经尝试添加:error_reporting(E_ALL); ini_set('display_errors',TRUE); 到我的index.php,但没有奏效。 另外我没有任何自定义error handling函数。 有没有人可以在PHP中导致白屏? 顺便说一下,它不是由一个未closures的括号造成的,如果我故意在index.php中显示一个错误。 但是,当我尝试加载一个沉重的页面,白色屏幕显示。 我正在使用相同的MySql服务器为其他应用程序没有问题。

如何在我的密码中使用salt设置Apache HTTP授权?

我使用Apache 2和MySQL 5 mod_auth_mysql进行Apache授权。 现在我们的密码被存储在我们的数据库中。 作为一个新的要求,我们必须用盐把它们储存起来,来对抗彩虹表攻击。 该文件指出: AuthMySQLSaltField <> | <string> | mysql_column_name Contains information on the salt field to be used for crypt and aes encryption methods. It can contain one of the following: <>: password itself is the salt field (use with crypt() only) <string>: "string" as the salt field mysql_column_name: the salt […]

Apache只loggingPHP生成的请求

我不确定这是否可能,还没有成功。 我试图在Web服务器级别上logging页面生成时间,并且现在可以使用mod_log_config和这个configuration来处理所有请求: LogFormat "%h %t %>s %b %T %D \"%r\" " timeformat CustomLog /var/log/httpd/timing_log "timeformat" 这是有效的,但logging所有请求的详细信息,包括静态内容,如图像,JavaScript,CSS,我不太在意。 有没有办法logging请求只有当它通过PHP? CustomLog指令具有可选的第三个参数,可以查看环境variables以确定是否logging请求。 我试着看SetEnvIf设置适当的,但还没有拿出任何东西。 build议?

php_memcache DLL的Windows – 我可以在哪里find它?

这是我find的唯一链接,但它不起作用。 http://pecl4win.php.net/ext.php/php_memcache.dll 我在哪里可以findphp_memcache扩展的预编译的DLL?

安装了php-gd,但是在运行nginx的CentOS 5.3服务器上的phpinfo中没有显示gd

以root身份login,我使用安装了php-gd库 $ yum install php-gd 它说一切正常,所以我做到了 $ /etc/init.d/nginx restart 但我一直在工作的代码仍抱怨没有gd库,当我去检查phpinfo的输出时,没有“gd”部分。 我应该注意到yum list | grep gd yum list | grep gd显示 gd.i386 2.0.33-9.4.el5_1.1 installed gd-devel.i386 2.0.33-9.4.el5_1.1 installed gdb.i386 6.8-27.el5 installed gdbm.i386 1.8.0-26.2.1 installed php-gd.i386 5.1.6-23.2.el5_3 installed 我还将extension=gd.so手动添加到了/etc/php.ini ,并且仍然没有显示或者提示错误,这导致我相信我的php.ini在重新启动nginx时不会被重新parsing。 是否有重新启动nginx之外的东西我必须做的php.ini更改加载? 虽然没有正式的培训,但我还是有相当数量(如3年)的特别服务器pipe理经验,但是我对nginx比较陌生,以前从来没有和CentOS一起工作过,所以任何帮助都不胜感激。

PHP通过FastCGI:“通过调用exit()终止”

我最近通过mod_fcgid设置将我的服务器从mod_php设置转换为了php。 一切运作良好:快速,简单,不会崩溃等等等等 我遇到的问题是日志文件填满了这样的消息: [Sat Nov 14 00:43:17 2009] [notice] mod_fcgid: process /var/www/fcgi-bin.d/php5-default/php-fcgi-wrapper(9451) exit(server exited), terminated by calling exit(), return code: 0 [Sat Nov 14 00:43:23 2009] [notice] mod_fcgid: process /var/www/fcgi-bin.d/php5-default/php-fcgi-wrapper(9453) exit(server exited), terminated by calling exit(), return code: 0 [Sat Nov 14 00:43:27 2009] [notice] mod_fcgid: process /var/www/fcgi-bin.d/php5-default/php-fcgi-wrapper(9457) exit(server exited), terminated by calling exit(), return […]

Apache使用公共文件设置多个站点

刚刚意识到我发布了这个错误堆栈溢出,所以这里是在正确的地方! 我有大约50个网站,所有使用CSS和IMAGES以外完全相同的文件,我目前每次创build一个新的网站和上传不同的CSS和图像复制文件。 我想要做什么,所以设置每个虚拟主机有相同的DocumentRoot然后添加的CSS和图像文件夹的AliasMatch例如: #Common Files VHOST <VirtualHost xxx.xxx.xxx.xxx:80> ServerName commonfiles.com ServerAlias www.commonfiles.com DocumentRoot /home/commonfiles/public_html </VirtualHost> #Sample vhost for 1 of the 50 sites. <VirtualHost xxx.xxx.xxx.xxx:80> ServerName mytest.com ServerAlias www.mytest.com DocumentRoot /home/commonfiles/public_html …… AliasMatch /css/(.*) /home/ftpuser/public_html/mycss/$1 </VirtualHost> 这个别名对于定制的文件来说是完美的,但是由于许可错误,通用文件不能被访问: [Mon Nov 16 09:31:01 2009] [crit] [client xxx.xxx.xxx.xxx] (13)Permission denied: /home/commonfiles/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure […]

如何configurationNginx通过多个FCGI进程来处理各种后端?

我见过很多教程,展示了如何通过各种FCGIstream程在nginx上设置PHP / Python / Perl / RoR 。 我find的教程都没有展示如何在一台服务器上提供多个FCGI服务。 如何configuration稳定的nginx(nginx-0.7.64)来为多个FCGI进程(每个上述语言一个)提供服务? 每个FCGI过程的示例地址如下所示: 127.0.0.1:8080 – PHP 127.0.0.1:8081 – Python 127.0.0.1:8082 – Perl 127.0.0.1:8083 – Ruby on Rails 一个示例configuration文件显示了如何实现多个FCGI的closures一台服务器是我真正需要的。 也许其他人也会受益。