Bluehost.com Web Hosting $6.95

why is which not working?

This is a discussion on why is which not working? within the PHP Language forums, part of the PHP Programming Forums category; Hi, I uploaded the following file to my site: <?php header("Content-type: text/plain"); echo "...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-27-2006
yusuf
 
Posts: n/a
Default why is which not working?

Hi,

I uploaded the following file to my site:

<?php
header("Content-type: text/plain");

echo "latex is at: ";
system("which latex");

echo "ls is at: ";
system("which ls");

echo "convert is at: ";
system("which convert");

echo "gs is at: ";
system("which gs");

?>

and none of the paths are being printed out, only the echo statements
are... I would think atleast ls should show up? Execute permissions
have been given to it too.

Reply With Quote
  #2 (permalink)  
Old 09-27-2006
Kimmo Laine
 
Posts: n/a
Default Re: why is which not working?

"yusuf" <yusufm@gmail.com> wrote in message
news:1159334679.095427.9430@i42g2000cwa.googlegrou ps.com...
> Hi,
>
> I uploaded the following file to my site:
>
> <?php
> header("Content-type: text/plain");
>
> echo "latex is at: ";
> system("which latex");
>
> echo "ls is at: ";
> system("which ls");
>
> echo "convert is at: ";
> system("which convert");
>
> echo "gs is at: ";
> system("which gs");
>
> ?>
>
> and none of the paths are being printed out, only the echo statements
> are... I would think atleast ls should show up? Execute permissions
> have been given to it too.



Are system/exec/passthru allowed on your php? Do you get any output from any
command, say ls or uptime or something else rather trivial?

Also try something like this for debugging:

$output = system('ls', $return_val)
var_dump($output); // This will be boolean false on failure
var_dump($return_val); // This will contain the return status of the command


--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
spam@outolempi.net || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)


Reply With Quote
  #3 (permalink)  
Old 09-27-2006
yusuf
 
Posts: n/a
Default Re: why is which not working?

> Also try something like this for debugging:
>
> $output = system('ls', $return_val)
> var_dump($output); // This will be boolean false on failure
> var_dump($return_val); // This will contain the return status of the command


They are printing out:

NULL
NULL

thanks.

Reply With Quote
  #4 (permalink)  
Old 09-27-2006
Kimmo Laine
 
Posts: n/a
Default Re: why is which not working?

"yusuf" <yusufm@gmail.com> wrote in message
news:1159340135.258673.299180@e3g2000cwe.googlegro ups.com...
>> Also try something like this for debugging:
>>
>> $output = system('ls', $return_val)
>> var_dump($output); // This will be boolean false on failure
>> var_dump($return_val); // This will contain the return status of the
>> command

>
> They are printing out:
>
> NULL
> NULL



Huh, it would seem like system function is disabled, since it returns
absolutely nothing. It's a configuration issue, so which propably works just
fine, php just can't access it cos it's not allowed.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
spam@outolempi.net || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:21 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0