编辑cgi文件然后网站停止
edited cgi file and then the website stopped
首先,我不是专家。
我一直在做一个网站。
我看过一个cgi文件:
eval {
# configuration
$ui_title="Something";
$ui_title_abbrev="Something";
$ui_dblue="#400080";
$ui_blue ="#6464FF";
$ui_lblue="#d0d9f4";
...
}
我已将参数 $ui_title 的值从 "Something" 更改为 "Something_else"。
然后网站停止工作了。
我已将值从 "Something_else" 更改为 "Something."
但是网站还是没有回到原来的状态。
请指教下一步。
如果你真的想深入了解错误,请查看网络服务器的错误日志文件。它将说明错误的确切原因。如果您不理解该错误,那么在 Google 上搜索它会为您提供更多详细信息,并可能提供问题的确切解决方案。事情永远不会无缘无故地停止工作。
以下答案假定您的网站托管在基于 Linux 的虚拟主机上:
根据我的经验,这种情况下最常见的错误是 file permission of the file changed when you edited it or updated it. Perl files or cgi files need the permission setting of 755 (set to executable) to work. In other words the file needs to be set to be executable. If you are using FTP to update/transfer the file there will normally be an option in the FTP program to set the file permission setting to 755 on the server. (with your ftp program) If you are in a Linux terminal window you can use chmod 设置文件的权限设置。还要仔细检查保存此文件的目录是否具有 755
的权限设置
这种情况很少见,但确实会发生:如果您使用 FTP 将文件传输到服务器,则可能是文件传输不正确。 (断开的连接、缓慢的互联网等)尝试重新传输文件。您还可以比较离线文件和服务器上文件的文件大小,确保它们相同。
此答案假设您正在使用 windows(在 Windows 中打开文件进行编辑)并且有一个基于 Linux 的服务器。如果您使用文本编辑器打开文件并且您的网络主机或网络服务器是基于 Linux 的,请确保您以 Unix 文件格式保存文件。有许多优秀或更高级的文本编辑器可以让您读取和保存 unix 文件格式的文件。获取像 Textpad 这样的好文本编辑器(免费试用)以打开文件并将其保存为 Unix 文件格式。
如果您是 Perl/CGI 脚本的新手,那么最好的建议可能是在更改文件之前备份该文件。如果代码没有问题,上面的3种解决方案可能是一些最常见的问题。
首先,我不是专家。
我一直在做一个网站。
我看过一个cgi文件:
eval { # configuration $ui_title="Something"; $ui_title_abbrev="Something"; $ui_dblue="#400080"; $ui_blue ="#6464FF"; $ui_lblue="#d0d9f4"; ... }
我已将参数 $ui_title 的值从 "Something" 更改为 "Something_else"。
然后网站停止工作了。
我已将值从 "Something_else" 更改为 "Something."
但是网站还是没有回到原来的状态。
请指教下一步。
如果你真的想深入了解错误,请查看网络服务器的错误日志文件。它将说明错误的确切原因。如果您不理解该错误,那么在 Google 上搜索它会为您提供更多详细信息,并可能提供问题的确切解决方案。事情永远不会无缘无故地停止工作。
以下答案假定您的网站托管在基于 Linux 的虚拟主机上:
根据我的经验,这种情况下最常见的错误是 file permission of the file changed when you edited it or updated it. Perl files or cgi files need the permission setting of 755 (set to executable) to work. In other words the file needs to be set to be executable. If you are using FTP to update/transfer the file there will normally be an option in the FTP program to set the file permission setting to 755 on the server. (with your ftp program) If you are in a Linux terminal window you can use chmod 设置文件的权限设置。还要仔细检查保存此文件的目录是否具有 755
的权限设置
这种情况很少见,但确实会发生:如果您使用 FTP 将文件传输到服务器,则可能是文件传输不正确。 (断开的连接、缓慢的互联网等)尝试重新传输文件。您还可以比较离线文件和服务器上文件的文件大小,确保它们相同。
此答案假设您正在使用 windows(在 Windows 中打开文件进行编辑)并且有一个基于 Linux 的服务器。如果您使用文本编辑器打开文件并且您的网络主机或网络服务器是基于 Linux 的,请确保您以 Unix 文件格式保存文件。有许多优秀或更高级的文本编辑器可以让您读取和保存 unix 文件格式的文件。获取像 Textpad 这样的好文本编辑器(免费试用)以打开文件并将其保存为 Unix 文件格式。
如果您是 Perl/CGI 脚本的新手,那么最好的建议可能是在更改文件之前备份该文件。如果代码没有问题,上面的3种解决方案可能是一些最常见的问题。