Home  >  Article  >  Backend Development  >  PHP问题集合

PHP问题集合

WBOY
WBOYOriginal
2016-06-23 14:32:321321browse

3.新手尝试php mail发送遇到:Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in.....

原因:smtp服务器不正确或端口不正确。。我这里用到的是qq邮箱发送。

解决方法:在php.ini 仲设置,并重启。

[mail function]; For Win32 only.SMTP = smtp.qq.com smtp_port = 25; For Win32 only.sendmail_from = PHP_INI_ALL

 设置后,开启qq邮箱smtp/pop3服务,

重新测试出现如下问题:SMTP server response: 503 Error: need EHLO and AUTH first !

原因,可能进行了多次恶意登陆,这是由于自己写的php发送邮箱步骤不正确。

在发送邮箱前,需进行登陆握手。

 

2.试着写几句php 命令遇到:parse error, unexpected T_CONSTANT_ENCAPSED_STRING

原因:词法分析错误,不被期望的字符常量问题。可能是关键字打错,或者{},“”之类的不匹配。

解决方法:在指定的错误行仔细检查一遍。

 

1.在安装完成后运行PHP测试文件,遇到:403 Forbidden:You don't have permission to access XXX.php/ on this server

原因:文件访问权限

解决办法:打开apache的httpd.conf,找到<Directory />,把整个区块替换成:<Directory />  Options FollowSymLinks  AllowOverride None  Order allow,deny  allow from all        ;这里把deny设置为allow.</Directory>保存,重启apache,OK了。

  

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP 文件与 HTTP HeaderNext article:禁用php函数