Page 1 of 1

New server doesn't run scripts.

Posted: Sun Feb 04, 2007 2:27 pm
by Joe
I am trying to transfer a site: loftyvistas.com to a new server 204.15.197.230/index.php but the index page etc does not seem to load on the new server. I have short tags enabled in the php.ini file etc but nothing is working. I haven't made any changes to the scripts or anything so I am puzzled here?. Should I be making edits to the php.ini file or something?. I have root ssh access.

The new server is a colocation facility.

Posted: Sun Feb 04, 2007 2:35 pm
by louie35
are you putting the files into the public_html folder?

Posted: Sun Feb 04, 2007 2:36 pm
by volka
does

Code: Select all

<?php phpinfo(); ?>
work?
If it does it shows you which php.ini is used. Open this file in a text editor and set the parameters

Code: Select all

error_reporting = E_ALL
display_errors = On
display_startup_errors = On
. SAve the file and restart the apache.

Posted: Sun Feb 04, 2007 3:13 pm
by Joe
Ok phpinfo(); works yes but when I try to edit the php.ini file I get an error saying "Read only file, not written"?

I am using the vi editor

Posted: Sun Feb 04, 2007 3:20 pm
by feyd
Run the following in a new file and tell us the results please.

Code: Select all

<?php

$neg = array('off', 0, false, '', null);
$flags = array(
	'Register Globals' => 'register_globals',
	'Short Tags' => 'short_open_tag',
	'Display Errors' => 'display_errors',
	'Magic Quotes GPC' => 'magic_quotes_gpc',
	'Magic Quotes Runtime' => 'magic_quotes_runtime',
	'Magic Quotes Sybase' => 'magic_quotes_sybase',
);
$ve = phpversion();
$os = PHP_OS;
$er = intval(error_reporting());
foreach ($flags as $n => $v)
{
	$flags[$n] = (in_array(strtolower(ini_get($v)), $neg) ? 'Off' : 'On');
}
$flags['Config file'] = get_cfg_var('cfg_file_path');
if (empty($flags['Config file']))
{
	$flags['Config file'] = '-';
}
$cli = (php_sapi_name() == 'cli');
$eol = "
";

$gle = get_loaded_extensions();
$rows = array();
$le = '';
$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)) . $eol;
}

$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;
	}
}
if (ceil(count($ec) / 2) + 1 < count($e))
{
	$e2 = array();
	foreach ($ec as $n => $v)
	{
		if (!in_array($n, $e) and $n != 'E_ALL')
		{
			$e2[] = $n;
		}
	}
	$er = $er . ' ((E_ALL | E_STRICT) ^ ' . implode(' ^ ', $e2) . '))';
}
else
{
	$er = $er . ' (' . implode(' | ', $e) . ')';
}

if (!$cli)
{
	echo '<html><head><title>quick info</title></head><body><pre>', $eol;
}

echo 'PHP Version: ', $ve, $eol;
echo 'PHP OS: ', $os, $eol;
echo 'Error Reporting: ', $er, $eol;
foreach ($flags as $n => $v)
{
	echo $n, ': ', $v, $eol;
}
echo 'Loaded Extensions:', $eol, $le, $eol;

if (!$cli)
{
	echo '</pre></body></html>', $eol;
}

?>

Posted: Sun Feb 04, 2007 3:40 pm
by Joe
I get this:

PHP Version: 5.1.6
PHP OS: FreeBSD
Error Reporting: 2047 (E_ALL)
Register Globals: Off
Short Tags: On
Display Errors: Off
Magic Quotes GPC: Off
Magic Quotes Runtime: Off
Magic Quotes Sybase: Off
Config file: /usr/local/etc/php.ini
Loaded Extensions:
standard SPL Reflection date
libxml apache2handler calendar ctype
curl dom ftp gd
iconv ldap mbstring mcrypt
mhash mysql openssl pcre
pdf zlib PDO posix
session SimpleXML tokenizer xml
xmlreader xmlwriter gettext

Posted: Sun Feb 04, 2007 3:44 pm
by Joe
Ok, I managed to set

display_errors = On
display_startup_errors = On

But no changes???

Posted: Sun Feb 04, 2007 4:13 pm
by volka
204.15.197.230/index.php wrote:Parse error: syntax error, unexpected '=' in /usr/local/www/apache22/data/lofty/index.php on line 2951