PDA

View Full Version : Help: Fixing the messy PHP in VHCS2 (ERROR)



Darknight
October 29th, 2007, 06:09
Well Im getting this error

ERROR (2): Header may not contain more than a single header, new line detected. (/var/www/vhcs2/gui/tools/webmail/inc/inc.php:155)
I found the code line 155 is "Cache-Control: must-revalidate");
im running php5.2
What should I do to clean this up?
Im very limited in php, the most I ever made was a upload script :lol:

/*
Don't remove the fallowing lines, or you will be problems with browser's cache
*/

Header("Expires: Wed, 11 Nov 1998 11:11:11 GMT\r\n".
"Cache-Control: no-cache\r\n".
"Cache-Control: must-revalidate");

$nocache = "
<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"no-cache\">
<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">";


EDIT: I just did this:

Header("Expires: Wed, 11 Nov 1998 11:11:11 GMT");
Header("Cache-Control: no-cache");
Header("Cache-Control: must-revalidate");
I want my VPS as clean as pos though, so if there is a better way please tell me :beer:

JonnyH
October 29th, 2007, 07:10
That should be fine ;)

Darknight
November 1st, 2007, 09:29
Ok more crap
Can someone smart like you tell me WTF this means?

Warning: ftp_rawlist() [function.ftp-rawlist]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/var/www/vhcs2/gui/tools/filemanager/:/tmp/:/usr/share/php/) in /var/www/vhcs2/gui/tools/filemanager/ftp.php on line 108

Warning: ftp_rawlist() [function.ftp-rawlist]: Unable to create temporary file. Check permissions in temporary files directory. in /var/www/vhcs2/gui/tools/filemanager/ftp.php on line 108
Its the file manager, What should I do, Edit some code or chmod something?

JonnyH
November 1st, 2007, 10:06
Check with your host if you can enable open_basedir

Darknight
November 1st, 2007, 12:14
I have a unmanaged VPS so I have to enable it :p, thats though.! :D

krakjoe
November 1st, 2007, 18:26
lets look at lines 100 - 115 ...

Darknight
November 3rd, 2007, 10:17
lets look at lines 100 - 115 ...

$alt_row = 0; // used for alternating line colors
$dir_count = 0; // used to count # of dirs displayed
$file_count = 0; // used to count # of files displayed
$dir_list = array(); // list of directories found
$file_list = array(); // list of files found

// Starts the directory listing
// Older php4 releases require seconds parm to be non-null [4/30/02 cjm2]
$files = ftp_rawlist ($fp, ".");

// if you can enter the directory but not read the directory listing clear the error
if ( substr_count($files[0], "Permission denied"))
{
$files = FALSE;
$sess_Data["warn"] = sprintf ( "%s: %s.", gettext ("Permission denied"), gettext("Directory listing unavailable") );
$sess_Data["level"] = "major";

But its only half the script
If you want the lot it starts at 86

<?php
// check for warnings to be displayed @ top of directory listing
if ( $sess_Data["warn"] != "" )
{
echo "<TR><TH COLSPAN=13>";
echo "<CENTER><B><FONT color=". $warn_color[$sess_Data["level"]] . ">";
echo $sess_Data["warn"];
echo "</FONT></B></CENTER>";
echo "<P>";
echo "</TH></TR>";

$sess_Data["warn"] = "";
}

$alt_row = 0; // used for alternating line colors
$dir_count = 0; // used to count # of dirs displayed
$file_count = 0; // used to count # of files displayed
$dir_list = array(); // list of directories found
$file_list = array(); // list of files found

// Starts the directory listing
// Older php4 releases require seconds parm to be non-null [4/30/02 cjm2]
$files = ftp_rawlist ($fp, ".");

// if you can enter the directory but not read the directory listing clear the error
if ( substr_count($files[0], "Permission denied"))
{
$files = FALSE;
$sess_Data["warn"] = sprintf ( "%s: %s.", gettext ("Permission denied"), gettext("Directory listing unavailable") );
$sess_Data["level"] = "major";
}

its_joy
November 2nd, 2008, 04:36
Well Im getting this error

I found the code line 155 is "Cache-Control: must-revalidate");
im running php5.2
What should I do to clean this up?
Im very limited in php, the most I ever made was a upload script :lol:

/*
Don't remove the fallowing lines, or you will be problems with browser's cache
*/

Header("Expires: Wed, 11 Nov 1998 11:11:11 GMT\r\n".
"Cache-Control: no-cache\r\n".
"Cache-Control: must-revalidate");

$nocache = "
<META HTTP-EQUIV=\"Cache-Control\" CONTENT=\"no-cache\">
<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">";


EDIT: I just did this:

Header("Expires: Wed, 11 Nov 1998 11:11:11 GMT");
Header("Cache-Control: no-cache");
Header("Cache-Control: must-revalidate");
I want my VPS as clean as pos though, so if there is a better way please tell me :beer:

Hello,

I did the changes as you stated but now i am facing new error.
{
ERROR (2): Cannot modify header information - headers already sent by (output started at /var/www/vhcs2/gui/tools/webmail/inc/inc.php:201) (/var/www/vhcs2/gui/tools/webmail/inc/lib.php:152)
}

Please let me know if there is any way to fix this.

Thanks in advance.

Zombie
November 6th, 2008, 21:22
Hello,

I did the changes as you stated but now i am facing new error.
{
ERROR (2): Cannot modify header information - headers already sent by (output started at /var/www/vhcs2/gui/tools/webmail/inc/inc.php:201) (/var/www/vhcs2/gui/tools/webmail/inc/lib.php:152)
}

Please let me know if there is any way to fix this.

Thanks in advance.
Mods stop approving the bumping posts anyway

http://www.phpfreaks.com/forums/index.php/topic,37442.0.html

read that