我有一个 PHP 脚本,它运行了好几个月。它最近停止工作。
此脚本连接到 gmail 以向我的客户发送电子邮件。
最近,我在运行脚本时开始收到此错误:
The SMTP connection failed to start [tls://smtp.gmail.com:465]:
fsockopen returned Error Number 0 and Error String 'php_network_getaddresses:
getaddrinfo failed: Temporary failure in name resolution'
Run Code Online (Sandbox Code Playgroud)
请记住,这是零代码更改。
我查看了我的 resolv.conf 似乎没问题:
nameserver 208.67.222.222
Run Code Online (Sandbox Code Playgroud)
我可以 ping gmail.com:
# ping smtp.gmail.com
PING gmail-smtp-msa.l.google.com (74.125.93.111) 56(84) bytes of data.
64 bytes from qw-in-f111.google.com (74.125.93.111): icmp_seq=1 ttl=247 time=26.7 ms
Run Code Online (Sandbox Code Playgroud)
我可以通过 lynx 连接到谷歌和其他网站,没有问题。
我已经登录我的 gmail 帐户没有问题(那里也没有验证码)。
我不知所措。谁有想法?
G-Man
来自 Windows 环境,我很好奇碎片整理程序在 *nix 中是否有用。更具体地说,OS X。
我正在尝试像这样运行 macports:
port install php5
Run Code Online (Sandbox Code Playgroud)
但是,当我这样做时,我收到此错误:
Error: Unable to open port: can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?
Run Code Online (Sandbox Code Playgroud)
所以我看了一下我的路径:
declare -x PATH="/Developer/usr/bin:/opt/subversion/bin:/opt/local/bin:/opt/local/sbin:/usr/local/php5/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
Run Code Online (Sandbox Code Playgroud)
然后查看以确保 make 位于其中一个目录中:
ls -l /Developer/usr/bin/make
$ lrwxr-xr-x 1 root admin 7 Aug 7 16:47 /Developer/usr/bin/make -> gnumake
Run Code Online (Sandbox Code Playgroud)
并键入:
make
Run Code Online (Sandbox Code Playgroud)
产生:
make: *** No targets specified and no makefile found. Stop.
Run Code Online (Sandbox Code Playgroud)
所以我知道它就在那里。
但是macports找不到它。有任何想法吗?
G-Man
我有一个名为“log.txt”的文件,我想每晚将其移动到日志文件夹。
问题是我想跟踪文件,所以我实际上需要将它移动到 log1.txt、log2.txt、log3.txt 等等。
是否有 unix 命令或 bash 脚本方式来执行此操作?
G-Man
我想运行一个 cron 作业。安排它很容易并且有效。
我的问题是我不知道如何一次只运行一个版本。
有任何想法吗?
G-Man