Articles of PHP

configurationpostfix阻止PHP发送的邮件()给某些收件人

我试图阻止我的CentOS 6.5服务器发送电子邮件到某个收件人列表。 ( [email protected][email protected]等)。 我已经configuration了这样的postfix: /etc/postfix/main.cf : smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/recipient_access / etc / postfix / recipient_access : [email protected] REJECT [email protected] REJECT DB通过以下方式构build: postmap hash:recipient_access postfix被重新加载 service postfix reload php.ini是: sendmail_path = /usr/sbin/sendmail -t -i 不幸的是,这似乎并不奏效。 如果我使用PHP邮件()发送邮件到[email protected] ,它将一如既往地交付。 我错过了什么?

灯不保存任何PHP日志

我有一个全新的vps服务器,Ubuntu 14.04,i686,Apache 2.4.7,php 5.5.9 这是我的虚拟主机: <VirtualHost *:80> ServerName example.com DocumentRoot "/home/drake/www/" DirectoryIndex index.php ErrorDocument 404 /404.html ErrorLog /home/drake/logs/error.log CustomLog /home/drake/logs/access.log combined </VirtualHost> ls -la / home / drake / logs: drwxrwxr-x 2 root root 4096 Apr 29 23:30 . drwxrwxr-x 2 root root 4096 Apr 29 23:30 .. 我有一个PHP文件index.php: <?php ecoja a3ad 我想testing日志文件,没有得到保存。 在我的php.ini我有: error_repoting […]

并行运行多个php版本

这个问题在我脑海里已经有一段时间了。 不幸的是,我并不真的期待一个解决scheme…也许有人可以至less告诉我为什么…. 我一直在运行多个PHP版本与Web服务器上的mod_fcgid很长一段时间。 不幸的是,我总是不得不自己编译除了一个(“系统版本”)以外的所有内容。 我可以做到这一点,没问题。 我只是想知道为什么没有来自“可信”来源的PHP包,可以彼此并排安装。 我认为现在运行PHP为CGI是相当普遍的,所以不同的PHP版本有不同的path对我来说显而易见。 我可以看到为什么大厂商(红帽子,debian)不会这样做,但为什么不像dotdeb(debian)或ius(centos)这样的软件包打包他们的PHP版本? 这只是一个咆哮,我没有做任何具体的研究发布之前,但我有一些build设web服务器的经验,我从来没有遇到这些php包。 thx的任何意见(甚至链接?) 马蒂亚斯

需要帮助安装PHP5-DOM

我尝试使用yum install php-xml在CentOS 6.5上安装PHP5-DOM,并得到这个错误: Error: Package: php-xml-5.3.3-27.el6_5.x86_64 (updates) Requires: php-common(x86-64) = 5.3.3-27.el6_5 Installed: php-common-5.4.28-1.el6.remi.x86_64 (@remi) php-common(x86-64) = 5.4.28-1.el6.remi Available: php-common-5.3.3-26.el6.x86_64 (base) php-common(x86-64) = 5.3.3-26.el6 Available: php-common-5.3.3-27.el6_5.x86_64 (updates) php-common(x86-64) = 5.3.3-27.el6_5 You could try using –skip-broken to work round the problem You could try running: rpm -Va –nofiles –nodigest 我怎么能安装在PHP 5.4?

由PHP脚本服务的虚拟web文件夹

我想configuration我的Apache能够显示(虚拟)页面,如:mywebpage.com/something1 mywebpage.com/something2 mywebpage.com/folder/something3 我想这些“somethingX”和“文件夹”文件夹只是虚拟的,而不是物理目录。 一开始,将所有的请求发送到mywebpage将是很好的一个PHP脚本,它将以某种方式接收原始path信息(据我所知有一些SERVER数组),并调用必要的PHP函数(到目前为止,我使用的地址,如mywebpage .COM /的index.php?页=布拉布拉&otherparameters =值…)。 那可能吗? 我正在努力与不同的组合,目前我在/etc/apache2/conf.d/something.conf(当然不工作)与以下文件。 什么是正确的方式进行? 谢谢。 <Location /myweb> SetHandler my-handler Action my-handler /srv/www/htdocs/myweb/product.php virtual </Location> 我的网页在/ srv / www / htdocs / myweb中。 我尝试使用位置,目录,与行动和SetHandler,与AddHandler … ;-)一些configuration被忽略,一些导致“对象未find”与错误日志中没有任何相关。

Apache SSLredirect循环

我们正试图将我们的网站从httpredirect到https。 我们在.htaccess中试过的所有东西都导致了redirect循环。 如果我们手动在url前input“https://”,我们的页面会返回jQuery error! 。 所以我怀疑这是不是所有请求的资源都通过https请求? 我们的htaccess文件: RewriteEngine on RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] # change rewrite base if not in root RewriteBase / # api RewriteRule ^(api)($|/) – [L] # index.php RewriteRule ^index.php$ – [L] # pass-through RewriteRule ^(css|js|site)/.*$ – [L] # redirect errors ErrorDocument 400 /error/400/ ErrorDocument 401 /error/401/ ErrorDocument 403 […]

在Mac OS X上执行“make test”时出现警告(MySQL PDO-> prepare())

这里是“make test”的结果: ===================================================================== TEST RESULT SUMMARY ——————————————————————— Exts skipped : 46 Exts tested : 33 ——————————————————————— Number of tests : 13061 9219 Tests skipped : 3842 ( 29.4%) ——– Tests warned : 1 ( 0.0%) ( 0.0%) Tests failed : 7 ( 0.1%) ( 0.1%) Expected fail : 38 ( 0.3%) ( 0.4%) Tests passed […]

502坏门户 – Nginx,spawn-fcgi,WordPress

我在CentOS VPS上托pipe了几个站点,并且一切正常,直到服务器上的一个WordPress站点开始返回502 Bad Gateway错误。 其他网站工作正常。 如果我重命名BuddyPress插件目录,WordPress网站将加载,但我不确定如何debugging此插件现在导致问题(该插件以前工作,并没有更新)。 完全相同的代码/数据库将正确使用我的本地Apache安装,所以它似乎是特定于服务器configuration。 不使用这个插件是不是一个选项,所以我的问题是更多关于如何debugging服务器configuration。 我的configuration: CentOS 5.10 Nginx 1.60 PHP 5.5 spawn-fcgi 1.6.3 错误: 浏览器 502 Bad Gateway nginx/1.6.0 Nginx / PHP错误日志 2014/06/28 19:40:13 [error] 8146#0: *22994 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: *.example.com, request: "GET / HTTP/1.0", upstream: "fastcgi://127.0.0.1:53217", host: […]

Exim4设置不适用于pipe道

我试图在服务器上设置exim4,以便它可以接收邮件的几个子域,我想pipe到PHP脚本。 我想通过我的自定义脚本(PHP)处理所有传入的邮件。 我在下面发布了一些我的设置细节。 我设置这个比较新,所以我很抱歉,如果我完全没有。 我已经尝试了下面的命令,它似乎没有做任何事情。 我在/var/mail中看不到任何新邮件,而且PHP脚本似乎没有被击中。 echo "This is a test." | mail -s Testing [email protected] 这是自定义路由器,在exim4.conf : cmd_router: driver = accept domains = +local_domains transport = cmd_transport no_verify 以下是exim4.conf中的exim4.conf : cmd_transport: debug_print = "T: using cmd_transport" driver = pipe command = /dir/to/php_mailer.php delivery_date_add envelope_to_add 这里是update-exim4.conf.conf文件: dc_eximconfig_configtype='internet' dc_other_hostnames='QAnetwork ; sub1.domain.net ; sub2.domain.net ; localhost' dc_local_interfaces='127.0.0.1 […]

从HTML格式发送电子邮件,而不是文本

我试图发送email每1小时从cron作业正在执行一个php脚本,从数据库中提取数据,并以表格格式显示。 我有CentOs 6.1在哪里我创build了我的cron作业。首先我从terminalyum install cronie我键入crontab -e并打开VI编辑器 在那里我把我的cron与MAILTO一样 MAILTO="[email protected]" 10 * * * * php /var/www/html/myfile.php 它发送电子邮件每1小时过去10分钟,但其发送电子邮件中的文本内容,我不想要的。 myfile.php <?php $con=mysql_connect("localhost","root",""); mysql_select_db("dbname",$con); $to="[email protected]" $subject = 'Count User Login And Application'; //fetch between 06:00:00 to 08:30:00 09:00:00 to 10:00:00 $date=array('06:00:00','09:00:00'); $date1=array('08:30:00','10:00:00'); $msg = '<html><head>'; $msg .='<title>Some Title</title>'; $msg .='</head>'; $msg .='<h1>Test User</h1>'; $msg .='<table border="1" cellspacing="1">'; $msg .= […]