PHP 5 solaris opendir failure


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting PHP 5 solaris opendir failure
# 1  
Old 05-19-2008
PHP 5 solaris opendir failure

Hello!

I've moved a web from my RHEL5 Apache/2.2.3 machine to a Sun Solaris 5.9 Apache/2.2.6 (Unix) PHP/5.2.5 mod_ssl/2.2.6 machine.

The web worked just fine on the rhel5 machine and most of the php pages works fine on the solaris machine to but not the one where I read a directory and prints out the files.

This is the code that does not work:
Code:
<?php
if ($handle = opendir('/the/directory')) {
    while (false !== ($file = readdir($handle))) {
       if(stripos($file, ".html")) {
          echo "<a href=waittimeofjobs/".$file.">".$file."</a><br/>";
       }
    }
    closedir($handle);
}
?>

It seems like that php just stops generating code when reaching this code because the source file gets empty, not even the static html tags gets written.

Is there some way to debug this?
Even if I remove the code and just puts a simple:
error_reporting(E_ALL);
the same thing happends, no code gets generated.
# 2  
Old 05-26-2008
maybe PHP is not configured properly/too strict
safe mode ON, open_basedir restriction, something like that
i had strange blank screens from these causes earlier
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Opendir

code: #include<iostream> #include <dirent.h> using namespace std; int main() { DIR*dir; dir = opendir("/"); if (dir !=NULL) { struct dirent * abcd; while ((abcd=readdir (dir))!=NULL) { cout << abcd -> d_name; } }} output : this gives the output of Directory "/" ques : (1 Reply)
Discussion started by: console
1 Replies

2. Programming

Opendir

code: #include<iostream> #include <dirent.h> using namespace std; int main() { DIR*dir; dir = opendir("/"); if (dir !=NULL) { struct dirent * abcd; while ((abcd=readdir (dir))!=NULL) { cout << abcd -> d_name; } }} output : this gives the output of Directory "/" ques : (1 Reply)
Discussion started by: console
1 Replies

3. Solaris

After power failure, SunFireV240 with SOLARIS 5.9 cannot start

SUNW, Sun Fire V240 Spare Sun OS Release 5.9 After a power failure we try to start the server We have the following messages: Thanks for your assistance (7 Replies)
Discussion started by: doudou2012
7 Replies

4. Solaris

Solaris Re-installation failure

Hello Community. I had installed solaris 5.10 OS on an X86 server using a custom-jumpstart installation program and it was performed successfully. Due to some issues, i had to go for reinstallation using the same jumpstart but this time it failed giving below error. Starting Solaris... (1 Reply)
Discussion started by: mystition
1 Replies

5. Solaris

Solaris 10 (05/09) xNTPD Startup Failure - How to Fix

Dear All, I installed the Solaris 2.10 (05/09) download on a Sparc platform, and wanted to configure the network time protocol daemon (xNTPD) to work as an NTP client. Of course there are many web sites that trumpet the advise to simply copy the ntp.client file to the ntp.conf file, and then... (2 Replies)
Discussion started by: iic1tls
2 Replies

6. Shell Programming and Scripting

Failure of sending mail through sun solaris

Hi Friends, I tried to mail from my sun solaris 5.8 by: $mailx -v sridha_151086@yahoo.co.in Subject: Test mail This is the test mail!! . EOT The error message I got is: land% Sri... forward: /export/home/Sri/.forward.+: World writable directory Sri... forward:... (1 Reply)
Discussion started by: sridharnr
1 Replies

7. Programming

opendir() + customly created directories

Gday all In a program I am designing, I am using opendir() to test whether entries under a certain directory are sub-directories or not. This method works fine for the directory itself (.) and the parent directory (..), however it does not work for any sub-directories I manually create. i.e.... (5 Replies)
Discussion started by: JamesGoh
5 Replies

8. UNIX for Dummies Questions & Answers

solaris second cd failure

We have a problem on a Sparc Ultra 5 box when installing solaris. We boot from the CD-ROM then go through the install procedure adding IP address, domain, routing details, hard disk layout etc.. The problem arises when asked for the 2nd CD at this point you do get the option to "skip"... (1 Reply)
Discussion started by: hcclnoodles
1 Replies
Login or Register to Ask a Question