duanhuantong8278 2012-08-29 19:39
浏览 68
已采纳

首次点击时PHP解析错误,然后分段错误[关闭]

I am trying to bring to life an old website for demonstration purposes. I am stuck with a PHP parse error and I can't find what it's about!

Here is the error I get (apache log) the first time I hit the page:

[error] [client 127.0.0.1] PHP Parse error:
parse error, expecting `T_STRING' or `'('' in .../functions.php on line 4

(the line return is for readability only) I end up with a 500 error.

Here is the only line I get the second time I hit the page:

[notice] child pid 3734 exit signal Segmentation fault (11)

This time I end up with a 324: ERR_EMPTY_RESPONSE.

Here is the code in the functions.php file, please don't look at the code it's very old ;).

<?php

// GoTo
function GoTo($page)
{
    global $FullPath;
    @header('Location:'.$FullPath.$page);
    echo "<script language='Javascript'>
                window.location='$page';
                </script>";
}

Do you see the parse error I am missing??

Why do I get a segfault the second time?

  • 写回答

2条回答 默认 最新

  • dongliaojing0554 2012-08-29 19:41
    关注

    You're using a newer version of PHP than you were when the site first came into existence, and goto has (sadly) been a keyword since PHP 5.3. Rename your function (:

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 易康econgnition精度验证
  • ¥15 线程问题判断多次进入
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致