Re: install error?..bug??
| From: | Jason Wong | Date: | Thu, 17 Oct 2002 17:56:09 +0000 |
| Subject: | Re: install error?..bug?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120370@lists.php.net to get a copy of this message | ||
On Thursday 17 October 2002 21:56, Howard wrote:
> Good morning,
>
> I'm reasonably new to the world of PHP and have loaded PHP V4.2.3 onto a
> Sun Solaris system running Solaris 8 with Iplanet (formerly Netscape)
> Version 6.0 with Service Pack 4 installed.
>
> I'm not sure exactly what "error" I am seeing, but I do know that there are
> some rather obscure errors being encountered while I am installing a PHP
> based package into our WebServer. I've no idea what is causing the
> problem - I can *SEE* the problem, but I have no clue what to do or where
> to turn to fix/address the issue.
>
> here is the scoop:
>
> inside of an "install.php" script that is executed via the webserver, is a
> section of code that looks like this:
>
> $path="./this.that";
>
> if(file_exists($path)==0 {
It's better (easier to understand) if you use:
if (!file_exists($path)) {
Also for debugging add:
echo "file does not exist";
> $styetext="";
> } else {
> $filesize=filesize($path);
> $filenum=fopen($path,"r");
> $styletext=fread($filenum,$filesize);
> fclose($filenum);
> }
> if ($styletext=="") {
> echo "<p> ensure that the this.that exists in teh current directory,
> and then reload this current page. </p>;
> exit;
> }
It's probably a bad idea to set $styletext in two places. What if
$styletext=fread($filenum,$filesize);
resulted in $styletext being empty? Then your error message would be
misleading.
> that's the code that is showing me that there is a problem. No matter how
> I set file protections or ownership, that file appears to never exist. If,
> however, I comment out this section of the code, the installation will run
> on to completion. That tells me that some of the calls like "if
> (file_exists....)" aren't giving back valid results - or , they simply
> aren't being executed as the install script expect (or it's a bug????).
Try a simple 'one' liner test program:
<?php
if (file_exists('name_of_this_file.php.')) {
echo "EXISTS"; }
else {
echo "DOES NOT EXIST";
}
?>
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Everyone's in a high place when you're on your knees.
*/