繁体   English   中英

Php脚本不能在Wamp Localhost上工作,但在远程服务器上工作正常

[英]Php Script not working on Wamp Localhost but working fine on remote server

当我在localhost上打开index.php时 - 显示完整或php错误的页面,如(unidentified variable等) ,网页根本不起作用。 但是完全相同的php文件在远程服务器上工作(例如Godaddy)

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中不起作用。 任何帮助表示赞赏。

J.

请试试这个:

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

当我在localhost上打开index.php时 - 显示完整或php错误的页面,例如(unidentified variable等)

您的localhost配置为显示所有错误或处于开发模式,并且您的服务器处于生产模式,通常仅显示致命错误

并且网页根本不起作用。 但是完全相同的php文件在远程服务器上工作(例如Godaddy)

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

尝试运行phpinfo(); 在您的服务器和本地主机中都有功能。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM