2014-10-04 199 views
0

当我打开工作正常index.php本地主机 - 显示全部或PHP错误,如(身份不明的变量等)和网页在不工作的页面所有。然而完全相同的PHP文件的远程服务器(Godaddy的举例)PHP脚本不工作WAMP本地主机,但远程服务器

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... 

我假设有一PHP SESSIONSlocalhost问题。我不知道为什么相同的脚本不能在localhost中工作。任何帮助表示赞赏。

J.

+0

我认为你的服务器是开发环境并显示所有警告或错误,而你的localhost不显示 – iatboy 2014-10-04 07:57:17

回答

2

请试试这个:

  1. 如果你使用WAMP服务器去php.ini文件
  2. 打开文件,然后搜索session.auto_start。
  3. 将session.auto_start = 0替换为session.auto_start = 1。
  4. 重新启动服务器。
0

当我打开index.php文件在本地主机 - 显示全部或PHP错误页面,如(身份不明变量等)

本地主机配置为显示所有的错误,或者在发展方式和你服务器处于生产模式,通常只会显示致命错误

并且网页完全不工作。然而完全相同的PHP文件远程服务器上的工作原理(Godaddy的举例)

有很多原因,它是工作在服务器上而不是在本地主机 他们中的一些.. 1. PHP扩展在启用你的服务器,但不在你的本地主机。 2.不同的PHP版本? 3. php.ini设置

尝试运行phpinfo();在你的服务器和你的本地主机中都有作用。

相关问题