Articles of PHP

configurationnginx服务器来处理来自多个域的请求

使用案例: –我正在开发一个Web应用程序,它允许创buildHTML模板并在亚马逊S3上发布它们。现在将我使用nginx作为代理服务器的网站发布出去。 代理服务器的function是,当用户input网站URL时,我想确定如何检查请求是否来自我的应用程序, 例如app.mysite.com (这不会改变),并将其路由到apache以进行常规访问,如果它来自一些其他的域像一个普通的URL www.mysite.com(这需要dynamic处理,可以是随机的),它转到承载模板的S3存储桶。 我目前的configuration是: user nginx; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; charset utf-8; keepalive_timeout 65; server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay off; […]

在xampp上从Roundcube发送的邮件在Gmail,Yahoo或Hotmail收件箱中不可见

我已经在Windows 8上的xampp服务器上下载并安装了Roundcube 0.9.5。当邮件正常显示在收件箱中时,收到邮件时效果很好。 但是,当我发送一个来自login帐户在roundcube(说gmail或雅虎)的邮件,我能看到发件人的“已发送”文件夹中的邮件,但无法看到收件人的收件箱中的邮件陆地甚至不在垃圾邮件文件夹中。 谁能告诉我可能是什么问题? 我已经configurationRoundcube从用户login占用SMTP和IMAP设置,以支持使用此插件多个smtp服务器和我的configuration文件夹的main.inc.php具有这些各自的variables: // IMAP // ———————————- $rcmail_config['default_host'] = array ( 'ssl://imap.gmail.com:993' => 'Google', 'ssl://imap.mail.yahoo.com:993' => 'Yahoo', 'ssl://imap-mail.outlook.com' => 'Outlook' ); $rcmail_config['multiple_smtp_server'] = array ( 'Google' => 'ssl://smtp.gmail.com:587', 'Yahoo' => 'ssl://smtp.mail.yahoo.com:465', 'Outlook' => 'starttls://smtp-mail.outlook.com:587' ); // TCP port used for IMAP connections $rcmail_config['default_port'] = 993; // IMAP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, […]

没有可用的Yum上的PHP-GD包…但它是

到目前为止我所做的 安装了CentOS 6.5 x64 安装了cPanel 将REMI和EPEL存储库添加到系统中 试过yum –enablerepo=remi,epel install php-gd 响应: 没有包php-gd可用。 完全响应 root@hostname [~]# yum –enablerepo=remi install php-gd –verbose Loading "fastestmirror" plugin Loading "security" plugin Config time: 0.042 Yum Version: 3.2.29 Setting up Package Sacks Loading mirror speeds from cached hostfile * base: centos.mirror.crucial.com.au * epel: mirror.optus.net * extras: centos.mirror.crucial.com.au * remi: remi.kazukioishi.net * […]

现在如何解决与Percona libmysql,他们已经导致与他们的软件包百胜冲突?

我几个月前写的一个脚本已经为大约100个或更多的虚拟服务器提供了一个LAPP堆栈(Linux Apache Percona PHP)。 最近,由于yum的Percona-XtraDB-Cluster-devel被标记为与Percona-Server-client-55冲突,这意味着你不能安装libmysqlclient_r,这是PHP构build的依赖项。 rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm 2>&1 >> $logfile; yum install Percona-Server-client-55 Percona-Server-server-55 percona-toolkit.noarch Percona-XtraDB-Cluster-devel -y 那么事情就会发生: Error: Percona-XtraDB-Cluster-devel-55 conflicts with Percona-Server-client-55-5.5.37-rel35.0.el6.x86_64 正因为如此,我无法编译PHP: checking for mysql_close in -lmysqlclient_r… no checking for mysql_error in -lmysqlclient_r… no configure: error: mysql configure failed. Please check config.log for more information. 我不可能是唯一一个试图从源代码编译PHP的人,有谁知道通过Percona安装libmysqlclient_r的方法吗?

如何保护浏览器访问的文件夹,但允许PHP脚本访问它

所以我现在有一个文件夹位于/ var / www / pictures,/ var / www是我的web服务器的文档根目录。 我想要图片文件夹抛出一个403禁止错误,如果用户试图访问该文件夹只是去mydomain.com/pictures,但我也需要一个PHP脚本位于/ var / www能够显示当用户转到mydomain.com/myscript.php时,从/ var / www /图片的图像。 有没有办法做到这一点? 提前感谢任何和所有的帮助!

百胜安装php-devel等命令返回问题

我运行yum install php-devel ,它返回这个。 通常我只是用–skip-broken运行它,但是当我这样做的时候,它仍然没有办法。 Available: php-common-5.3.3-22.el6.x86_64 (rhel-x86_64-server-6) php-common(x86-64) = 5.3.3-22.el6 Available: php-common-5.3.3-23.el6_4.x86_64 (rhel-x86_64-server-6) php-common(x86-64) = 5.3.3-23.el6_4 Available: php-common-5.3.3-26.el6.x86_64 (rhel-x86_64-server-6) php-common(x86-64) = 5.3.3-26.el6 Available: php54w-common-5.4.29-2.w6.x86_64 (webtatic) php-common(x86-64) = 5.4.29-2.w6 Available: php54w-common-5.4.30-1.w6.x86_64 (webtatic) php-common(x86-64) = 5.4.30-1.w6 Available: php55w-common-5.5.13-2.w6.x86_64 (webtatic) php-common(x86-64) = 5.5.13-2.w6 Installing: php55w-common-5.5.14-1.w6.x86_64 (webtatic) php-common(x86-64) = 5.5.14-1.w6 You could try using –skip-broken to work around […]

包括每个请求的PHP scirpt

我不知道是否有可能,并包含一个总是为每个文件运行的PHP脚本。 我不应该包含从PHP文件的PHP脚本,但我想能够包括一个脚本,总是从php.ini或类似的东西运行。

Nginx以纯文本格式(Mod_Rewrite)提供php文件,

在Nginx中没有.htaccess(Mod_Rewrite)。所以我把我的.htaccess转换成可以读取并放在default.conf中的格式。 原始htaccess: Options -Indexes RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php?/$0 [PT,L] 将htaccess转换为Nginx格式: # nginx configuration autoindex off; location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?/$0 break; } } 正确…即时问题在那里.. Nginx不支持参数$ 0, 所以我已经改变了这个$ uri 问题我现在有..当我访问我的网站http://vibeshed.com/admin我得到下面的结果:(顺便说一句,我只是下载文件,但我删除了默认的MIMEtypes)。 见图: 任何帮助? 我的网站default.conf是: # # The default server # server { listen 80; server_name vibeshed.com; […]

Postfix / OpenDKIM不签署PHP发送的电子邮件

我们安装了SPF,DKIM和DMARClogging,用于电子邮件安全性/可validation性。 通过控制台或Outlook或Mac邮件等邮件客户端发送邮件时,邮件会完全处理并全部通过。 通过Zend Framework 1.12的SendMail函数发送失败(php)。 我们有没有错过configuration有一些PHP电子邮件签名? 我们看什么文件? 还是必须有不同的安装/附加? 我们在Cent OS 6上使用OpenDKIM和Postfix 后缀-n结果: alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man milter_default_action = accept milter_protocol […]

在parsing它们之前,Apache中是否有一个选项来检查PHP文件是否存在恶意代码?

基本上,我希望Apache在parsing它们之前检查某些模式的PHP文件。 如果这些PHP文件匹配模式,我想发送其他更换回给用户。 有没有办法做到这一点?