简体   繁体   中英

Php Script not working on Wamp Localhost but working fine on remote server

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)

the index.php file starts with

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

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

the header.php files starts with:

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

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.

Please try this:

  1. If you use wamp server go php.ini file
  2. Open file and search session.auto_start.
  3. Replace session.auto_start = 0 to session.auto_start = 1.
  4. Restart your server.

When I open index.php on localhost - the page showing full or php errors such as (unidentified variable, etc)

your localhost is configured to display all errors or in development mode and your server is in production mode that usually display fatal errors only

and the web page is not working at all. However exact same php files works on remote server (Godaddy for example)

there are many reason it was working on your server but not in your localhost some of them are.. 1. PHP extension that is enabled in your server but not in your localhost. 2. Different PHP version? 3. php.ini settings

try to run phpinfo(); function both in your server and in your localhost.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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