PHP脚本无法在Wamp Localhost上运行,但在远程服务器上可以正常运行 [英] Php Script not working on Wamp Localhost but working fine on remote server

查看:176
本文介绍了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. 重新启动服务器.

这篇关于PHP脚本无法在Wamp Localhost上运行,但在远程服务器上可以正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆