Exec(), System(), Shell_exec(), Etc + Nmap
i'm trying to create a script that executes nmap from my server, then displays the output.
i've tried:
$output = passthru('nmap -v -A'.' $ip');
$output = shell_exec('nmap -v -A'.' $ip');
system('nmap -v -A'.' $ip');
the problem i'm having is that using the above methods i only get the first line of output, ie.
Starting Nmap 4.20 ( http://insecure.org ) at 2007-08-31 21:46 CST
and nothing else. i've managed to find a way around it by sending the nmap output to a textfile, the using file_get_contents() to pull the data back in:
exec('nmap -v -A '.$ip.' > /usr/local/www/apache22/data/nmap/'.$ip.'.html');
$file = "/usr/local/www/apache22/data/nmap/$ip.html";
$result = file_get_contents($file);
echo "(pre)$result(/pre)";
that works perfectly, but i'd rather not be writing anything to the drive. i guess the problem might be that nmap takes about 5-10 seconds to do its scan, and for some reason php doesn't want to wait that long, i really have no idea. can it be made to work without needing to write to files?
and for the curious minds, i'm not doing anything dodgy, i just wanted an online tool i could access from any computer to test networks i support .
View Complete Forum Thread with Replies
Related Forum Messages:
- Exec, Shell_exec, System, And Passthru Not Working At All
- System(), Exec(), Shell_exec(), But "Permission Denied"
- Exec Or Shell_exec
- Exec()-shell_exec
- Exec And Shell_exec
- Problem: Exec() And Shell_exec()
- Exec Or Shell_exec For Dumping MySql Info?
- Exec And Shell_exec Not Executing Batch File Properly
- Shell_exec Using System Tools - Wait For Process To Finish
- PHP System() And Exec()
- System() And Exec()
- Exec(), System()
- Bug In System And Exec Commands
- System() Or Exec() And Permissions
- Exec() And System() Problems
- Using Passthru(), Exec(), System() Etc.
- System/shell/exec/etc
- Exec(), System() And Win 2003
- Use Exec() In PHP 5.2 On A Windows XP Pro System
- Problem Using System/exec Function.
- Using System/exec, How To Backup Database?
- System/exec Not Working In Browser
- Command Window - Exec/system
- Exec And System Commands Blocked By Host
- Alternates To System() And Exec() In Order To Use ImageMagik?
- Exec - Create An Executable That Return The System Drives
- Running An .exe File Using Exec() Or System(), Unable To Fork Error
- Warning: Ftp_exec() [function.ftp-exec]: SITE EXEC Is An Unknown Extension
- Warning: Exec() [function.exec]:
- Shell_exec Help Please
- CLI And Shell_exec()
- Ssh With Shell_exec
- SSL Through Shell_exec
- Cd With Shell_exec
- Shell_exec
- Basic Shell_exec
- Shell_exec Need Any Configuration?
- Shell_exec() Return Nothing
- Shell_exec, Python
- Shell_exec On LightTPD
- Specifying Paths Using Shell_exec
- Shell_exec - Cd Is Not Working
- Shell_exec( ) Function
- Shell_exec On The Localhost?
- Shell_exec And Variables
- Shell_exec() Output
- Output From Shell_exec
- Shell_exec Not Working On Win2K3
- Shell_exec Causing CGI ERROR
- Shell_exec And Perl::Expect.pm
- Shell_exec() Works Randomly
- Shell_exec() Server (fedora 3.1)
Exec, Shell_exec, System, And Passthru Not Working At All
Can't get these commands to work! The following page simply doesn't finish loading ( Waiting... Opening... :-( ) <?php echo system("dir"); ?> The same for <?php echo exec("dir"); ?> or <?php echo shell_exec("dir"); ?>, etc... I'm running Apache 2.0.55 & PHP 5.0.5 with Zend Optimizer v2.5.10 on windows XP SP2.
View Replies !
Exec Or Shell_exec
I am trying to us shell_exec and keep getting an error. I do have safe_mode = off also. Code: if ($publish == "yes") { $command = "e:scriptspublish.bat"; $result=shell_exec($command); } The publish.bat file does work and I have proper permissions set in windows, I set everyone full access. Oh, Windows server, IIS6.0, PHP. Error is as follows: Warning: shell_exec() [function.shell-exec]: Unable to execute 'e:scriptspublish.bat' in
View Replies !
Exec()-shell_exec
my server: apache2/php5 and win2k3. I'm able to use shell_exec or exec for dos command that doesn't require auth. I would like to exec certain dos command under "domainuser" "password" .So I'll be able to access remote computer etc... example: echo shell_exec(find /i "SomeDataImLookingFor" "RemoteWorkstationc$ ext.txt) if i use this command in a dosshell under my user session it will return data.Of course if i execute this with PHP on the server with the phpserver account it won't function. I have been looking for a while on google and forums but i can't find it ,i just need someone to point me to the right page/post/.
View Replies !
Exec And Shell_exec
I'm new to running exec commands on php. I've had ffmpeg installed on my server, at /usr/local/bin/ffmpeg (a cmd line video decoder). It's a linux server, running php5. From looking around the internet, I came up with this code to run it: Code:
View Replies !
Problem: Exec() And Shell_exec()
I've got the following problem: exec() and shell_exec(), etc. don't give anything back, just the error code 127 For example, the following script: <?php exec("cat ./test", $lines, $result); // or exec("./cat ./test", $lines, $result); echo "result = $result<br>"; echo "Lines<br> "; foreach ($lines as $k => $v) { echo "k=$k v=$v<br> "; } ?>
View Replies !
Exec Or Shell_exec For Dumping MySql Info?
I'm trying to figure out how to export info from a Mysql database, using PHP to manage the export, as phpMyAdmin manages to do. I'm guessing I need to run a shell script that looks like this: mysqldump -u username -ppassword database_name FILE.sql and I need to call this shell script using one of the functions on this page: Code:
View Replies !
Exec And Shell_exec Not Executing Batch File Properly
I am running Apache and PHP on windows XP. Latest versions of them all. I am trying to execute a simple .bat batch file that simply copies 4 files from one location to the batch files location. The php exec command runs like this: V:Corehtdocswp ransfer.bat Y:folder here the batch file is executed and the command following is thrown into the batch file to specify where the files that need to be copied are. The Y: directory is in windows considered to be a network drive, although it is really just a folder on the same machine, i did this because there are spaces in the folder names on its way to where I need the information copied from i.e. "Program Files" When I run this in the command prompt by entering this in manually it runs perfectly. However when running exec in the PHP script nothing happens; when I run shell_exec it gives me the output and it shows that every line in the batch file is executed however it does not actually copy anything. Looking into my apache error log I see that this is related: "The system cannot find the drive specified." Now what I am wondering is, how is it that I can run this script manually but apache tells me I cannot. My permissions are set to allow all and deny nothing since it is a machine well tucked into a safe place. Apache resides on the machine in C: eactorcore and it also setup a virtual drive as v:core. Trying both does not work.
View Replies !
Shell_exec Using System Tools - Wait For Process To Finish
I have a problem that hopefuly someone here knows the answer to. I want to do a shell_exec command from PHP. I then want to continue with the script when the shell program is finished with what it does. Problem here is, that will take approximately one hour. How do I make the script wait until the program that I call in shell_exec is finished?
View Replies !
PHP System() And Exec()
Background: I am trying to execute a binary on the server located in the current directory where the php script is being run. The server is a linux (debian based). I am having trouble getting php to execute the binary properly, below is my code. Code:
View Replies !
System() And Exec()
If you start a program using this function and want to leave it running in the background, you have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends. I have tried numerous time by redirecting to a file or other stream to free up a php web page that called a perl script for example, but the php script always hangs...has anyone had any luck freeing up a calling php script from a process, or program that it launched in the background? Code:
View Replies !
Exec(), System()
I write very, very simple script who call external program. The script is run on Linux Slackware, Apache/1.3.37 (Unix) mod_ssl/2.8.28 OpenSSL/0.9.8b PHP/4.4.4 here is my script: <?php echo exec('ls'); ?> this work properly. but if i write: <?php echo exec('xine'); //xine is a multimedia player ?>
View Replies !
Bug In System And Exec Commands
If PHP is running via a web server, and mutiple system calls are made within the script to another script, hundreds of processes are created. Here is an example: Script 1: <?php for ($i=1; $i<=5; $i++) { system("php script2.php"); } ?> Script 2: <?php exit; ?> The effect is the same (and more difficult to stop) when the system calls are made in the background. e.g. system("php script2.php >>/dev/null 2>>/dev/null &"); system("php script2.php >/dev/null 2>&1"); I have even tried calling a shell script, which in turn calls the second PHP script (both in the background), but it still causes lots of processes. The "exec" command is also affected. At first, I thought this was a problem with either Zeus web server of Fast CGI, but I have since tried it with Apache and normal CGI with the same effect. Does anyone have any idea why this happens and whether there is any way to prevent it? I have posted a bug report to bugs.php.net (ID 14997), but so far to no avail.
View Replies !
Exec() And System() Problems
I am trying to use php's exec() or system() to execute a shell script that I wrote. exec and system() work fine with a simple command like ls, but nothing happens when I point it at the shell script. The shell script works fine from my shell login. Can't figure out what tho problem is. Is php just incapable of running shell scripts?
View Replies !
System/shell/exec/etc
I've got PHP 5.1.6, Apache 2.2.2, on Fedora 5. Everything is great except that when I use an of the external launching commands, persistent apps dont stay open. I have a simple shell script set up to load an app, and I have it write a PID file. Immediately after calling exec (milliseconds later) the PID is alive. However, within a few more milliseconds it seems to close. I've made sure that the apache uid/gid have full access to the script and the apps it calls. When sudo'ing manualy in a shell with the apache uid, the script works flawlessly and loads the program, and stays open, as it should. I've verified that the app loads under the uid 'apache' with ps. When running it through PHP, it seems to close almost immediately after succeeding. Is there some fundamental issue with how this works that I'm missing? I can't seem to get any real errors out of php, apache, or even the shell when redirected to a file. Should I try PHP4? Is PHP5 buggy with this kind of thing? I even tried running 'at' to schedule the script (so that it'd be invoked by at instead of the shell itself) but that failed, silently, as well.
View Replies !
Exec(), System() And Win 2003
I have searched high and low for the past 2 days for an answer to my problem. I have found a few references, but nothing has helped me. My problem is this: I am trying to ping a remote server from a PHP script in IE 6.0. When I load the page, the cmd.exe loads on the server and takes up all my CPU. I have to manually stop the process for it to go away. My setup is this: Windows 2003 Server PHP 5.0.1 I have tried - giving my system32cmd.exe full IUSR_%machinename% rights - moved the cmd.exe to the script folder, to the PHP folder And about a million other things that I can't remember =(. I have tried multiple functions, written in mulitple ways and the outcome is always the same. when the cmd.exe is opened it hangs on the 2003 server.
View Replies !
Use Exec() In PHP 5.2 On A Windows XP Pro System
I'm trying to use exec() in PHP 5.2 on a Windows XP Pro system. What I'm trying to do is use it to tell an already running program what to. For example: X:pathprogram.exe /something or X:pathprogram.exe /something_else If I do the command through the command line, it works, but so far I have been unsuccessful in PHP. Usually it PHP just hangs, and give no error message, and does nothing to the program.
View Replies !
Problem Using System/exec Function.
I am faced with strange problem. Basically I want to make a script which would take mysql back up for me. I have come up with following. [ basically code is borrowed from some other place ] PHP Code:
View Replies !
Using System/exec, How To Backup Database?
system("mysqldump --opt myDatabase > backup.sql"); here are my problems, i don't think it works on the webserver. next, where exactly the file, backup.sql be place if it does succeed. i believe we just can't execute commands on the webserver can we? i also tried using the sql query BACKUP TABLE ... TO .. but i'm guessing the problem lies with the TO... how do i know what directory shall i place it therE? for instance, my pages are placed in, home/myname/public_html/... i tried to put home/myname/public_html/backup in the TO but nothing happens.
View Replies !
System/exec Not Working In Browser
In two files, and I serve foo.php then I notice If I use commandline execution i.e. php foo.php then foo.txt is touched/created all right. i.e. system command is executed as expectedBut If I use browser then I notice that the shell command in config.php is *not* executedAny ideas as to why this might be happening? Code:
View Replies !
Command Window - Exec/system
I'm in the process of developing a script in Windows where I need to use exec/system. Whenever I execute either, Windows spawns a command window which automatically sappears. Is there a clean way to force Windows to NOT display the command window? I've seen this discussed a few times previously, but, none of the solutions seem to be working (tried both exec and system; tried using cmd /c, tried using start /B, etc.)
View Replies !
Exec And System Commands Blocked By Host
I've got this code, its the simpliest example I could make. It works perfectly on my windows xp/apache/php box, but doesn't do anything on a commercial website host. The actual code should use gzip to compress a folder but that doesn't work either. Anyone know the reason why they would be blocking these commands? I suspect the problems with commonly used php apps like phpBB to be the real reason. <? exec("ping 127.0.0.1 > test.txt") or die(); // get contents of a file into a string $filename = "test.txt"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); fclose ($fd); echo $contents; ?>
View Replies !
Alternates To System() And Exec() In Order To Use ImageMagik?
My Web host apepars to not allow exec() and system(), as a line in my script: system("convert -scale 100x100 $uploadfile $toimage"); gives the error: "Warning: system() has been disabled for security reasons" Is there some other way to use ImageMagik (or is it GhostScript?)'s "convert" command in PHP that may be safer and generally allowed by Web hosts?
View Replies !
Running An .exe File Using Exec() Or System(), Unable To Fork Error
I have a problem with running an .exe file using exec() or system() I have downloaded a file called ffmpeg.exe for converting movie clips. I can use the program thourg the command line in windows (cmd), but I'm not able to have PHP run the file. First PHP gave be an "unable to fork" error. But then I gave users access to the cmd.exe file and solved that problem. So now is no problem running for example exec("dir");
View Replies !
Warning: Ftp_exec() [function.ftp-exec]: SITE EXEC Is An Unknown Extension
This is kind of a part II to a question a posted earlier about exec and shell_exec not working. I'm trying to use ftp_exec to execute some simple command: $conn_id = ftp_connect("$server") or die ("Cannot initiate connection to host"); ftp_login($conn_id, "$username", "$userpass") or die("Cannot login"); $command = 'cd..' if (ftp_exec($conn_id, $command)) { echo "$command executed successfully"; } else { echo "could not execute $command"; } ftp_close($conn_id); I'm getting the following error: Warning: ftp_exec() [function.ftp-exec]: SITE EXEC is an unknown extension in /home/urieilam/public_html/work/video/test1.1.php on line 21 could not execute cd.. Have tried other commands as well, get the same. Could this be a security issue or something to do with p Safe Mode? I don't know much about commands, shell, etc..
View Replies !
Warning: Exec() [function.exec]:
I'm using PHP Version 5.0.4 in IIS5, Window 2003. When I execute my script, it prompt me the following error : Warning: exec() [function.exec]: Unable to fork [ping 10.8.1.70] in c:Inetpubwwwrootswitch.php on line 62 Below is my script : <?php $line1 = exec("ping 10.8.1.70", $output); exit; ?>
View Replies !
Shell_exec Help Please
I have an ensim server which provides me with about 20 scripts in the filesystem that allows you to create sites, edit them, lookup domains, etc... I am running a few of these scripts from a cron I made and that all works fine but I can't seem to find a function (like shell_exec) that allows me to get the text returned from the function. When I run the script from CLI and i run the script using either system(), exec(), passthru(), or shell_exec() it just displays the results, and I didn't tell it to, it just does it on it's own bit. My question is how can i trap the results so I can anylize them.
View Replies !
CLI And Shell_exec()
I am using Imagemagick and some other apps via command line calls (if I stated that correctly, hope so).I run a WinXP server, Sambar 5.3. I use this format for my typical call: PHP Code:
View Replies !
Ssh With Shell_exec
I'm trying to 'ssh' into another machine, run a small script and fetch it's output, using shell_exec(). The problem is, it takes AGES to run ssh and I don't know what's happening. If I try 'ssh'ing manually on the shell, it takes a microsecond to fetch the result, whereas shell_exec takes very very long and I don't know how to debug the problem. That's problem number one: How do I tell what's happening and why is it taking so long? Problem two: To be able to establish a password-less ssh connection, I generated a public key/private key pair for the two machines and stored it in my /home/username/.ssh directory. Okay, I know apache/php (by the way I'm running apache with PHP 4.2.3) won't know where to find it so I presumed /opt/apache/.ssh would be the best place to copy the ".ssh" directory (i.e. apache's installed in /opt/apache). Now the problem is, I couldn't get shell_exec to run ssh in a password less mode. After a little while I realized that it was looking for the private key in "/.ssh" (i.e. the root directory)! How come? How do I change it so that it looks for the .ssh directory elsewhere? (I mean, how can I run a command using shell_exec and ask it to use the "home" directory of the "apache" user, which normally is /path/to/apache)? The last time I installed php & apache, I remember it looked for the .ssh directory in the /opt/apache/.ssh directory and now it has changed. also, it was much faster the last time. Now for some reason it's EXTREMELY slow (takes a whole minute to run ssh) and looks for the .ssh directory on the root (and I dont want to place that directory there).
View Replies !
SSL Through Shell_exec
I've looked at the php documentation for openSSL, but found that the module seemed insufficient for purposes like checking a certificate's expiration date on another server. That is, I could not find a function to run "openssl s_client -connect", so I decided to instead achieve it through shell_exec. This is a three step process: 1) Check the openssl version via shell_exec('openssl version -v'); just to confirm that openssl is installed and runs properly. This returns "OpenSSL 0.9.7a Feb 19 2003 " 2) Connect to the remote server. As a test, I decided to use www.gna.org, since I know they use a certificate. shell_exec('openssl s_client -connect www.gna.org:4433'); This pauses for about 20 seconds, and then returns FALSE. I've tried various combinations, like removing the -connect argument but leaving the server name in, removing the port, including the https:// part, removing the www, and so on. I have not tried a port other than 4433 yet (I wouldn't know what other part to use). All other methods returned FALSE immediately. This is the only method that delays 20 seconds, which indicates to me that I'm close. 3) Fetch certificate expiration date via shell_exec('openssl x509 -enddate'); although this obviously returns FALSE because I have not been able to connect to the server yet.
View Replies !
Cd With Shell_exec
I have the following script: $c_path = "/absolute_path_to_some_directory"; $test_cmd = "cd $c_path; ls"; $test_res = shell_exec($test_cmd); it always lists the contents of the directory where it is placed, rather than the contents of some_directory. In other words, it appears that cd is not working. I have verified that path and permissions are correct. PHP is version 4.3.9.
View Replies !
Shell_exec
I want to copy file from remote machine to local machine using PHP. On both machines Linux operating system present. The code is. $result=shell_exec("scp admin@192.168.1.236:/mnt/disc/hda/part1/demo/ conn /opt/lampp/htdocs/upload/");
View Replies !
Shell_exec() Return Nothing
I ran into a problem with shell_exec() PHP and all files hosting on Redhat I have a html page that allow me to enter a linux command, then submit, then I get the output print out between $output. when enter command: ls -l /etc, it a list of file and directory on /etc as expected however, when I tried to execute my program at /etc/earch/esearch (esearch is executable), I received nothing back. however when I telnet to server, command /etc/earch/esearch does return some text. i'm sure php was running as same user as telnet.
View Replies !
Shell_exec, Python
Read some garbage tutorial on About.com about embedding my python script inside PHP with shell_exec() but it's not working, as I expected. Does some kind of configuration have to occur first for this to happen? I have python installed but I can't run it from anywhere at my dos prompt. I have to be in the python25 folder (i installed using a windows installer on python.org) for it to work. I'm running IIS, Win2000, Python 2.5.1, PHP 5.2.3
View Replies !
Shell_exec On LightTPD
I've got a very simple script with shell_exec that's giving me a headache! My server is a NetBSD machine running LightTPD (1.4.8nb1) and php (5.1.1nb2). I've got the file dummy.php with the following content: <?php error_reporting(E_ALL); $res = shell_exec("pwd 2>&1"); echo $res; ?> When I access this file through a browser i can't see any output: http://my.url/dummy.php results in a blank page that loads in no time! No error messages, neither output by the browser or in the log files (php.log and LightTPD's error.log). When I use the terminal on the servern it all works fine: php /path/to/wwwroot/dummy.php gives me the working directory. Doesn't matter from which working directory I execute the command, or which user (I've tried the LightTPD user aswell). It works every time! safe_mode is off and there are no disabled_functions! I've asked around in LightTPD forums, but they say it's a PHP problem. So, I've asked around in (other) PHP forums but noone seems to have any ideas how to solve this! Perhaps there are expert users here that can help me, or at least redirect me to some other expert forum.
View Replies !
Specifying Paths Using Shell_exec
i use xampplite locally, winxp. from PHP, this creates a blank mydump.sql file: shell_exec("mysqldump --allow-keywords --opt -uroot mydb > mydump.sql"); but this works fine: shell_exec("c:xampplitemysqlinmysqldump --allow-keywords --opt -uroot mydb > mydump.sql"); but if i use the second one on my pages, im afraid the code might not work anymore when i transfer the site to my server, because of the path. any suggestions???
View Replies !
Shell_exec - Cd Is Not Working
I have the following script: $c_path = "/absolute_path_to_some_directory"; $test_cmd = "cd $c_path; ls"; $test_res = shell_exec($test_cmd); Regardless of where I put the script, when executed, it always lists the contents of the directory where it is placed, rather than the contents of the some_directory. In other words,it appears that cd is not working. I have verified that path and permissions are correct. PHP is version 4.3.9. What's wrong ?
View Replies !
Shell_exec( ) Function
i trying to use shell_exec on a unix-type platform and can't seem to get it to work. Can anyone help me with the shell_exec command problem? below is the coding of my: <?php $output=shell_exec('ll -lart'); echo "$output"; ?> suppose when i run this two line of php coding, there should be a output displayed. but no output displayed.
View Replies !
Shell_exec And Variables
I'm trying to execute a shell command within a loop to fetch a filename that is stored in an array, but it's not substituting the array with the contents of the array. Here's what I have: Code:
View Replies !
Shell_exec() Output
I am trying to get information from a shell on my server by using shell_exec() but the outputted data is not formatted and I cannot for the life of me figure out how to make the output appear how I want it. For example if I do a whois query I get the full output with returns so it is all dumped on 1 line. Is there a way to make the outputted data appear the same as if I had performed the same query using SSH? Is there a way to make data from a traceroute appear line by line instead of waiting for the query to execute completly before dumping the data? I am assuming it can be done with Java but I am not sure.
View Replies !
Output From Shell_exec
i'm having trouble with shell_exec. according to php.net the output of the command is returned by shell_exec(), but this is not the case. i've tried exec,passthru and system but can't get the output into a variable. PHP Code: $ffmpeg = escapeshellcmd('ffmpeg -i "'.$uploadPath['orgVideo'].$org.'"'); $tmp = shell_exec($ffmpeg);Â Â Â Â Â Â Â Â echo " "; print_r($tmp); echo " "; .....
View Replies !
Shell_exec Not Working On Win2K3
We have PHP 4 installed on Windows 2003 with Apache 2, and the shell_exec has mysteriously stopped working - it hangs the page rather then returning anything. To check it out, I tried shell_exec("dir") which works fine on the development machine, but not on the live server. I'm guessing the network guys have done something to the security of the live server that would cause this - but it's very strange; why would Apache (running under the default system account) not allow PHP to run shell_exec statements? I have checked PHP and it's not in safe mode. I'm a bit stuck -
View Replies !
Shell_exec Causing CGI ERROR
I have a php page that needs to call a batch script. My test script has one line: echo test. I am running Win2003 Server, IIS, and php 4.3.10. When I first tried running my php script I got an error that said "unable to execute ...". Then I granted the IIS user execute privledges to cmd.exe (I know, I know ... security risk). Once I did that, my script gives me a CGI ERROR - something about http headers. I've scoured google groups and come up with nothing that works. I tried one solution that uses an executable called bgrun.exe. That exe calls my batch script - still no luck. I've tried exec() and shell_exec(). No difference. I've tried saving the result to a variable and not. No difference.
View Replies !
Shell_exec And Perl::Expect.pm
I have a perl script that I'm calling using php's shell_exec that uses an expect module to go to another system to pull tiff files. The php perl combination works great when I launch from the commandline: $php docpull.php I get the files I want. Everything is perfect. When I run docpull.php through the web server I get to the expect call in the perl script where the password is passed and the script fails. No error in any of the logs or return from either php or perl. I believe that its an environment issue regarding how php is run through the web server and what the expect module from perl needs for a pty. I think this is the case because I can see the scp command output that perl expect is generating gets to the password but after that there is no error. Expect needs to have a pty to work with and I think that when I run through the command line I have one but when I run through apache I lose access to ptys. Permissions don't seem to be a problem because I've set up all of the directories involved with uncomfortably open perms and I've run the command line version as the Apache user. I'm reaching at this point. Because of another server limitation I'm stuck with php 4 and Apache 1.3 for the time being. If anyone has any other suggestions for pulling files from a remote server I'd be happy to give them a try, however, the scp with expect will solve lots of other problems I'll have to deal with. I'm on slackware linux 10.2 Apache/1.3.33 (Unix) PHP 4.4.1 (cli) (built: Dec 21 2005 03:44:49) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Xdebug v2.0.0beta5, Copyright (c) 2002, 2003, 2004, 2005, by Derick Rethans This is perl, v5.8.7 built for i486-linux The expect module I'm using is Expect-1.20
View Replies !
Shell_exec() Works Randomly
In another post I told about PHP not being able to create dates earlier than 1970, so until I can get PHP to do so, I am using a small perlscript to do it. It looks like this: //$in[date]*is something like "1943-10-12"; $unixtime = shell_exec("bin/converttime.pl $in[date]"); Problem is, this fails once ever twenty times or so - shell_exec() doesn't return anything. This is true of another place where I use shell_exec() to run /usr/bin/cal so I don't think the problem is with the application I am trying to execute.
View Replies !
Shell_exec() Server (fedora 3.1)
i have full access to the shell of the server (fedora 3.1) but running this code in a php file on xampp server that i have on the same server , i am not getting the output even when i am trying to pipe the output to an html file . Code:
View Replies !
|