473,461 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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.

Sep 27 '06 #1
3 1068
"yusuf" <yu****@gmail.comwrote in message
news:11********************@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
sp**@outolempi.net || Gedoon-S @ IRCnet || rot13(xv***@bhgbyrzcv.arg)
Sep 27 '06 #2
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.

Sep 27 '06 #3
"yusuf" <yu****@gmail.comwrote in message
news:11**********************@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
sp**@outolempi.net || Gedoon-S @ IRCnet || rot13(xv***@bhgbyrzcv.arg)
Sep 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Herman | last post by:
Hi everyone, I'm currently studying for my Master's in Computer Science, and I will be working on my thesis this summer. I've been thinking about constructing a web services application for my...
17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
17
by: clintonG | last post by:
I'm using an .aspx tool I found at but as nice as the interface is I think I need to consider using others. Some can generate C# I understand. Your preferences please... <%= Clinton Gallagher ...
15
by: mc | last post by:
I'm writing an app for managing Task Lists, I'm trying to add some controls to a form that I can use to link tasks, my original intention was to: - Add two list boxes, one listing "all Tasks"...
3
by: sara | last post by:
Very strange behavior, but I suspect some is A2K and some might be for me to correct. Just trying to see if anyone can help and advise. We have a database that's been running for a few years...
7
by: vinthan | last post by:
hi, I am new to python. I have to write test cases in python. An application is open in the desk top ( application writen in .Net) I have to write code to get focuse the application and click on...
2
by: monomaniac21 | last post by:
Hi all we are thinking of using a version control system at work. I was wondering what are some of the issues we should take into consideration when deciding upon which one to use? and which...
4
by: shankari07 | last post by:
hi guys , i have developed a website which works fine in one server but not working in another server. the problem is i have a button which clears up the session variables that is not working...
84
by: Patient Guy | last post by:
Which is the better approach in working with Javascript? 1. Server side processing: Web server gets form input, runs it into the Javascript module, and PHP collects the output for document prep....
0
by: Paul Moore | last post by:
I have a 3rd party application which, as far as I understand, does not use the CRT at all. It has a plugin architecture which allows developers to write DLLs to expose additional functionality. ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.