Program working well in localhost,but not in the internet!
Moderator: General Moderators
-
manikandan
- Forum Newbie
- Posts: 10
- Joined: Sat Oct 07, 2006 1:43 am
Program working well in localhost,but not in the internet!
Hello frinz,
i'm new to this forum. i have developed a web based application program using PHP5,MySql. It s working well in internet. Now i had been modified one file(i'm not modifiying any of the DB based file,just modified application file alone). After modifying i upload that file into web server. That modified page alone not working well, i mean that page displays HTML content alone,it didn't fetch the data from DataBase. But this system working well in my localhost. Its not working well , when its uploaded into internet.
i don't know about the problem . Could you please help me to come out from this problem?
Thanking You in advance!
Regards,
Manikandan S
i'm new to this forum. i have developed a web based application program using PHP5,MySql. It s working well in internet. Now i had been modified one file(i'm not modifiying any of the DB based file,just modified application file alone). After modifying i upload that file into web server. That modified page alone not working well, i mean that page displays HTML content alone,it didn't fetch the data from DataBase. But this system working well in my localhost. Its not working well , when its uploaded into internet.
i don't know about the problem . Could you please help me to come out from this problem?
Thanking You in advance!
Regards,
Manikandan S
-
manikandan
- Forum Newbie
- Posts: 10
- Joined: Sat Oct 07, 2006 1:43 am
Dear frinz,
I'm working in the MNC company, due to the confidential of the code my project leader not allowing me to post my code here.I'm extremly sorry for that. And i checked both my localhost php.ini file and server's php.ini file, both are in same configuration. And register_globals is set to "off".
Thanks and Regards
manikandan s
I'm working in the MNC company, due to the confidential of the code my project leader not allowing me to post my code here.I'm extremly sorry for that. And i checked both my localhost php.ini file and server's php.ini file, both are in same configuration. And register_globals is set to "off".
Thanks and Regards
manikandan s
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
-
manikandan
- Forum Newbie
- Posts: 10
- Joined: Sat Oct 07, 2006 1:43 am
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Run the following in a new file (on both systems) and tell us the results please.
Code: Select all
<?php
$neg = array(0, false, '', null, 'off');
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
$rg = (in_array(strtolower(ini_get('register_globals')), $neg) ? 'Off' : 'On');
$de = (in_array(strtolower(ini_get('display_errors')), $neg) ? 'Off' : 'On');
$so = (in_array(strtolower(ini_get('short_open_tag')), $neg) ? 'Off' : 'On');
$le = '';
$cli = (php_sapi_name() == 'cli');
$eol = ($cli ? "\n" : "<br />\n");
$gle = get_loaded_extensions();
$rows = array();
$wide = 4;
$j = count($gle);
$pad = $wide - $j % $wide;
$len = max(array_map('strlen', $gle));
$func = create_function('$a', 'return str_pad($a, ' . intval($len) . ');');
$gle = array_map($func, $gle);
for($i = 0; $i < $j; $i += $wide)
{
$le .= ' ' . implode(' ', array_slice($gle, $i, $wide)) . "\n";
}
if ($cli)
{
$le = $eol . $le;
}
else
{
$le = '<pre>' . $le . '</pre>';
}
$ec = array(
'E_STRICT' => 2048, 'E_ALL' => 2047, 'E_USER_NOTICE' => 1024,
'E_USER_WARNING' => 512, 'E_USER_ERROR' => 256, 'E_COMPILE_WARNING' => 128,
'E_COMPILE_ERROR' => 64, 'E_CORE_WARNING' => 32, 'E_CORE_ERROR' => 16,
'E_NOTICE' => 8, 'E_PARSE' => 4, 'E_WARNING' => 2, 'E_ERROR' => 1,
);
$e = array();
$t = $er;
foreach ($ec as $n => $v)
{
if (($t & $v) == $v)
{
$e[] = $n;
$t ^= $v;
}
}
$er = $er . ' (' . implode(' | ', $e) . ')';
if (!$cli)
{
echo '<html><head><title>quick info</title></head><body>' . "\n";
}
echo 'PHP Version: ' . $ve . $eol;
echo 'PHP OS: ' . $os . $eol;
echo 'Error Reporting: ' . $er . $eol;
echo 'Register Globals: ' . $rg . $eol;
echo 'Short Tags: ' . $so . $eol;
echo 'Display Errors: ' . $de . $eol;
echo 'Loaded Extensions:' . $le . $eol;
if (!$cli)
{
echo '</body></html>' . "\n";
}
?>-
manikandan
- Forum Newbie
- Posts: 10
- Joined: Sat Oct 07, 2006 1:43 am
Dear Mr.Everah,
I have run your programs in both the localhost and in the server.
SERVER OUTPUT:
PHP Version: 4.3.2
PHP OS: SunOS
Error Reporting: 2039 (E_USER_NOTICE | E_USER_WARNING | E_USER_ERROR | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_WARNING | E_ERROR)
Register Globals: Off
Short Tags: On
Display Errors: On
Loaded Extensions:
xml tokenizer standard session
posix pcre overload openssl
mbstring gettext dio dba
ctype zlib apache mysql
mcrypt
LOCALHOST OUTPUT:
PHP Version: 5.1.6
PHP OS: WINNT
Error Reporting: 2039 (E_USER_NOTICE | E_USER_WARNING | E_USER_ERROR | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_WARNING | E_ERROR)
Register Globals: Off
Short Tags: On
Display Errors: On
Loaded Extensions:
bcmath calendar com_dotnet ctype
date ftp hash iconv
odbc pcre Reflection session
libxml standard tokenizer zlib
SimpleXML dom SPL wddx
xml xmlreader xmlwriter apache2handler
gd gettext imap mbstring
exif mime_magic ming mssql
mysql mysqli openssl pdf
PDO pdo_mssql pdo_mysql smtp
soap sockets SQLite xmlrpc
xsl zip
I'm awaiting for your reply sir,
Thanking you,
Regards,
Manikandan
I have run your programs in both the localhost and in the server.
SERVER OUTPUT:
PHP Version: 4.3.2
PHP OS: SunOS
Error Reporting: 2039 (E_USER_NOTICE | E_USER_WARNING | E_USER_ERROR | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_WARNING | E_ERROR)
Register Globals: Off
Short Tags: On
Display Errors: On
Loaded Extensions:
xml tokenizer standard session
posix pcre overload openssl
mbstring gettext dio dba
ctype zlib apache mysql
mcrypt
LOCALHOST OUTPUT:
PHP Version: 5.1.6
PHP OS: WINNT
Error Reporting: 2039 (E_USER_NOTICE | E_USER_WARNING | E_USER_ERROR | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_WARNING | E_ERROR)
Register Globals: Off
Short Tags: On
Display Errors: On
Loaded Extensions:
bcmath calendar com_dotnet ctype
date ftp hash iconv
odbc pcre Reflection session
libxml standard tokenizer zlib
SimpleXML dom SPL wddx
xml xmlreader xmlwriter apache2handler
gd gettext imap mbstring
exif mime_magic ming mssql
mysql mysqli openssl pdf
PDO pdo_mssql pdo_mysql smtp
soap sockets SQLite xmlrpc
xsl zip
I'm awaiting for your reply sir,
Thanking you,
Regards,
Manikandan
Code: Select all
Your server-php only "knows" mysql while your localhost-php can use mysql(i), mssql and sqlite.manikandan wrote:SERVER OUTPUT:
[...]
Loaded Extensions:
xml tokenizer standard session
posix pcre overload openssl
mbstring gettext dio dba
ctype zlib apache mysql
mcrypt
LOCALHOST OUTPUT:
[...]
Loaded Extensions:
bcmath calendar com_dotnet ctype
date ftp hash iconv
odbc pcre Reflection session
libxml standard tokenizer zlib
SimpleXML dom SPL wddx
xml xmlreader xmlwriter apache2handler
gd gettext imap mbstring
exif mime_magic ming mssql
mysql mysqli openssl pdf
PDO pdo_mssql pdo_mysql smtp
soap sockets SQLite xmlrpc
xsl zip
What type of database do you use?
-
manikandan
- Forum Newbie
- Posts: 10
- Joined: Sat Oct 07, 2006 1:43 am
Does your code contain any error handling for the mysql operations?
The simplest isDoes your code contain something like this (maybe far more sophisticated)?
Is the code before and after the database querries executed? (Does it produce output?)
The simplest is
Code: Select all
$db = mysql_connect(,,) or die(mysql_error())
mysql_select_db(,$db) or die(mysql_error());
$query = '...';
$result = mysql_query($query, $db) or die (mysql_error());
if ( 0==mysql_num_rows($result) ) {
echo 'no results';
}Is the code before and after the database querries executed? (Does it produce output?)
-
manikandan
- Forum Newbie
- Posts: 10
- Joined: Sat Oct 07, 2006 1:43 am
Dear Mr.Volka,
Yes i'm using those kind of error handling mechanisms for mysql operations before the queries are executed.
Thanks and Regards,
Manikandan
Yes i'm using those kind of error handling mechanisms for mysql operations before the queries are executed.
Code: Select all
$db = mysql_connect(,,) or die(mysql_error())
mysql_select_db(,$db) or die(mysql_error());
$query = '...';Manikandan
Try something like
Is the echo statement executed?
Does it find any matching records?
Code: Select all
$result = mysql_query($query, $db) or die (mysql_error());
echo "\n<div>Debug: ", mysql_num_rows($result), " records found.</div>\n";Does it find any matching records?