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了。

  

相关文章:

  • 2021-11-04
  • 2022-02-28
  • 2021-09-17
  • 2021-12-18
  • 2022-03-03
  • 2021-07-22
  • 2021-04-03
  • 2021-10-23
猜你喜欢
  • 2022-02-28
  • 2022-01-01
  • 2022-03-02
  • 2021-09-24
  • 2021-08-27
  • 2022-01-15
相关资源
相似解决方案