PHP脚本无法在Wamp Localhost上运行,但在远程服务器上可以正常运行

问题描述:

当我在 localhost 上打开index.php时-该页面显示完整或php错误,例如(未识别的变量等),并且该网页完全无法正常工作.但是,完全相同的php文件可在远程服务器(例如Godaddy)

When I open index.php on localhost - the page showing full or php errors such as (unidentified variable, etc) and the web page is not working at all. However exact same php files works on remote server (Godaddy for example)

index.php文件以

<?
require_once ('templates/header.php');
?>
<div class='grid_12'>
<table>

<div id="form" > and son on....

header.php文件以

<?php
session_start();
include('classes/secure.class.php'); // include the class
$secure = new secure(); // load the class
$secure->secureGlobals(); // run the main class function

require_once ('config.php');
require_once ('functions.php');
require_once ('templates/commonheader.php');
require_once ('lang.php');

header('Content-type: text/html; charset=$charset');

?> and so on...

我认为 localhost 中的PHP SESSIONS存在问题.我不知道为什么相同的脚本在 localhost 中不起作用.感谢您的帮助.

I assume there is a problem with PHP SESSIONS in localhost. I dont know why the same script is not working in localhost. Any help is appreciated.

J.

请尝试以下操作:

  1. 如果使用wamp服务器,请转到php.ini文件
  2. 打开文件并搜索会话.auto_start.
  3. 将session.auto_start = 0替换为session.auto_start = 1.
  4. 重新启动服务器.