Disable The 'exec' Function
How do I disable the 'exec' function in my linux php server? It's important in order to prevent users from planting PHP browsers on their shell account.
View Complete Forum Thread with Replies
Related Forum Messages:
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 !
Mail() Function Blocks Webpage For Nameserver Lookup ! How Can I Disable It?
When mail() function reaches a wrong email address or a down domain name (which it can not resolve it to its IP address) it blocks PHP page for a while. How can I disable this behaviour? I was able to disable this in mail clients such as Pine by setting an option that tells "Do not make DNS lookups before ading mail to queue" . Is there anything in PHP for doing this?
View Replies !
Exec Function
Iv tried using this exec function and iv never used it before today.. im not completely sure what it does. <?php $command = "/movie/Without a Paddle.avi"; echo exec($command); ?> I hoped that this script would open up a movie, but it doesnt. I am using this function completely wrong or is there a problem with my code?
View Replies !
Exec() Function
I'm having trouble getting the exec() function to work in my script. I have never worked with this function and before I contact my server admin I want to verify my code is correct. script_name.php is in the same directory as this script that is running exec(). Is this correct? exec("./script_name.php &");
View Replies !
Function Exec
I'm trying to execute a command with "exec" but it doesn't work. Here is my code : PHP Code: exec("../../blast/blastall -p blastn -d est.txt -i testseq.txt -o test.txt"); I'm sure that my scrypt reads this line but nothing happen. Does someone know how to use this function ?
View Replies !
PHP Exec Function No Output
I am running PHP 5.1.6 (cli) on Linux. When i use the exec($cmd, $output, $return) command the $output array is always blank if the command had an error in it. There are only values if the command was successful. How do I capture the error text returned?...
View Replies !
Php Exec() Function Is Not Working
I am trying to execute linux command with php. I am try to log on as super user, so I have used the following code: exec("su root"); exec("<password>"); But I dont think its working, becuase if I want to change my directory and view the list, I find myself in the same directory. I have used the following code: exec("cd /"); Passthru("ls -l");
View Replies !
Ssh2 Mod And Exec Function
Something very strangne happens with the function ssh2_exec, i can't read the stream answer after execution in the remote computer. I work with apache 1.3.30 and php 4.3.10 , libssh 2.0.5 . the ssh2 module looks to work correctly but sftp functions cause a big delay causing server timeout and ssh2_exec can't read the output. Tryed many things recommeded in php website and forums but always the first ssh2_exec reading success and the following ones fail. $stream=ssh2_exec($conn_id,'/usr/bin/ls ./public_html'); I tryed to read the output with: stream_set_blocking( $stream, true ); $cmd=fread( $stream, 4096 ); after while($line = fgets($stream)) { $cmd .= $line; } and while( !feof($stream) ) { $cmd .= fgets($stream) } Nothing success to catch the output for the second execute order. In the same process only the first exec could be read. Anybody know
View Replies !
Can Not Execute Exec Function In Php
I am facing a strange problem , in linux server system commands like exec, system are enabled but one particular command is not working properly , either its returning null or 127. Command is exec(whois -h whois.crsnic.net "bnbnmnmbnmn.com") But this command is working properly in another linux server. Any suggestion is well come excepting reinstall or re-configuration as its not possible . Commands like exec('whoami') are working . Server:linhost161.prod.mesa1.secureserver.net 2.4.21-27.ELsmp #1 SMP Wed Dec 1 21:59:02 EST 2004 i686
View Replies !
Using Exec() Function In PHP5
I have problem by using exec() function in PHP5, Apache and Windows XP to run an external program from my PHP page reside on server. When I call my program using exec() the page just stops (waiting for www.mysite.com...). I have used by absolute path and result was same. Also, I have tested my PHP page by running by using PHP (or PHP-cgi) interpreter in command line and it just works fine without any problem. I don't know why it doesn't work when I call it from my page. Can anybody help ? I think it is something wrong with Apache or PHP settings. Am I right ?
View Replies !
Exec() Function And Shell Scripts
I have a shell script written that basically grabs a selected .jpg or .png image file and wraps it as an .swf file for use in a dynamic Flash site. My question is this: What are the limitations of the exec() or system() commands? I can get them to work just fine with common linux commands(ie. ls -l, pwd, etc.), but it won't run these sort of commands: ./thisisascirptname or sh wrapper.sh I get no results with these and yet when I perform the same operation on the command line by hand, it works just fine. This is the script I'm using to test it, by the way. $lastline = exec("sh wrapper.sh", $all_output, $return_value); print("<b>Last Line:</b><br>$lastline <p> "); print("<b>All Output:</b><br> "); for($index = 0; $index < count($all_output); $index++) { print("$all_output[$index] <br> "); } print("<br><br> "); print("Return Value: $return_value<br> "); The "ls" and other similar functions all return properly. I can't figure this out and it's driving me nuts. Any help?
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 Exec Function To Get A .exe Return Status Gives CGI Error
I'm trying to make a web page to work. It worked before so it has to be something related with the configuration. My problem is a call to a compiled executable (made for me) that returns 1 or 0. It does not print any text to the standard ouput so the error is strange: CGI Error: The script can .. because of the HTTP headers (I have it in spanish so the message is not the exact one). As supposed, the HTTP headers are needed only if the executable prints out a text to the browser but it's not the case. And (I repeat) It worked as it before. The machine had to be formatted and the guy in charge of that is not with me anymore.
View Replies !
Exec() Function Warning: Unable To Fork (Access Violation At 77F81B4D)
I am trying to execute a DOS command with the exec() function. All I get is fork errors or access errors, regardless of what file I try to execute. Example: <?php exec("sync.bat"); `sync.bat`;?> Warning: Unable to fork [sync.bat] in C:testexec.php on line 3 Warning: Unable to execute 'sync.bat' in C:testexec.php on line 4 PHP has encountered an Access Violation at 77F81B4D Id doesn't seem to matter what kind of file I try to execute, .exe, .bat or .com. Any ideas? Has ANYONE executed an external program under php/Windows?
View Replies !
Disable RFI In Php.ini
I've read somewhere that it's possible to disable RFI (Remote File Inclusion) in php.ini. Is this true? If so, can someone tell me what setting I should adjust in php.ini to disable RFI. Disabling this, does mean that includes like Code: include("../include/somefile.php"); still work right?
View Replies !
Disable Checkbox
I have a checkbox that I set by php code to be either "checked" or "". I want to disable the ability of the user to check or uncheck it. I tried "readonly", but that didn't work.
View Replies !
Can I Disable $PHP_AUTH_PW?
Is there any way I can disable the setting of the environment variable $PHP_AUTH_PW? I'm authenticating via LDAP, and don't need (or want) the password available to PHP. I also don't need $PHP_AUTH_USER; the current authenicated user is available in $LDAP_USER.
View Replies !
Disable Submit
I am wondering if there is a way using php to disable the submit button (to avoid dual submission by impatient people). I already use javascripts to verify required fields and save cookies. I haven't been able to use the numerous javascripts I've found to disable the submit button, as most require putting an "onsubmit" statement into the body tag and I already have one. When I tried adding another separated by a semicolon, it only does the first of them. When I add onclick="this.disabled=true;" to the submit button tag, it disables the button upon clicking but does not actually submit the form. Also, I can't have it disable the button if there are required fields missed, as they are sent back to the same page with the fields hightlighted and they wouldn't be able to hit submit a second time to "resubmit" the info.
View Replies !
Disable Notices
I've been getting "Notice: Undefined index:" for $_GET and $_POST variables. I've fount away around this by using isset(): if( isset( $_GET["name"] ) ) {  $name = $_GET["name"]; } else {  $name = ""; } I'm also getting a notice when I use the date() function without quotes around an argument: date( i ); I don't mind making these changes. Probably better anyway, but I'm at a loss to why these notices have started to show up. I haven’t changed anything, and my php.ini file is set to not display notices.
View Replies !
Disable The Output_handler For PDF
We decided to use output_handler = ob_gzhandler on one of our server, because it is very slow and this is the only option that keeps the old page on screen instead of clearing it before displaying the new one. With this configuration a problem arises in creating PDF docs to be displayed on fly, because IE asks for download instead of opening the pdf reader (while Netscape works fine). I've been told that this is a IE bug. However all of our user run IE and it should difficult to convince them to use another browser because IE is said to have a bug. Probably they would think that we programmers have a bug !! The documentation says that ini_set() allows to operate on output_handler parameter, than I thougt that a ini_set('output_handler','') before sending the pdf should solve the problem. It does not seem to work. The only way is to disable output_handler from php.ini. I've alredy posted on bug.php but it has been immediately classed as bogus without any investigation, because, they said, this is a IE bug. Can anybody help me to find a way to disable the output_handler only when we send the pdf.
View Replies !
Disable Download
I have a web site which provide some content using Flash. I want to protect the flash file, disallow people from downloading. how to do it ? should i use client side javascript? or control in server side ?
View Replies !
Disable A Hyperlink
How to disable a hyperlink or a textbox or a command button which is in page 2 from page 1? Suppose i have an admin page and a userpage. i have a details page which holds add,delete,view and search links or buttons or textboxes. i want to access all these from admin page.But i want userpage to access only the search feature of details page.
View Replies !
Meta Disable
How do i disable a browser from refreshing the meta tags everytime it loads a page? Im trying to hide websites from a web filter.
View Replies !
Disable The Form
PHP Code: <input name="prepare_by" value="<? $sql10="Select * from employee where ID ='$_SESSION[username]'"; $query10 = mysql_query($sql10) or die mysql_error()); $result10 = mysql_fetch_assoc($query10); echo $result10['prepare_by']; ?>"Â Â /> ..........
View Replies !
Disable (grey Out) A Button.
Experienced programmer but new to PHP. Moreover I'm to use PHP with Xoops on top (this adds object orientation?). I don't seem to find a xoops Usenet group? Whatever the case (and presumably a Xoops property): how does one disable (grey-out) a button?
View Replies !
Disable Right Click In Opera
In my website there is requirement to disable rightclick. I am providing the code and it is working in I.E ,Netscape and Mozilla.But not working in Opera browser. My code is <body oncontextmenu='return false;'> The above single line code is working very fine in the above browsers not in Opera.
View Replies !
Disable Phpinfo In Php3
In PHP4 there is the posibility to disable the use of phpinfo() by putting "disable_functions = phpinfo" in the php.ini-file. Is this also possible with PHP3 (in php3.ini) or is there another way of disabling this function?
View Replies !
How To Completely Disable Openbase_dir?
I'm using php 4.3.4 and have an intermitent problem with gallery (gallery.sourceforge.net) regarding the open_basedir restriction in php. The error I am getting is: ------ PHP Warning: (null)(): Failed opening '/home/httpd/vhosts/mydom.com/httpdocs/gallery2/main.php' for inclusion (include_path='.:/usr/share/pear') in Unknown on line 0, referer: http://mydom.com/gallery2/main.php ------ I have disabled safemode and open_basedir in php.ini and have verified through a phpinfo() call that they are disabled. Actually, open_basedir is reported as being set to "no value" and safemode is reported as disabled. The strange thing is that this does not happen every time i access this page. It is only 1 out of 10 times and usually it is the first time i access the page for the day(but not always). I have restarted httpd and the server just in case. I also checked .htaccess but it shouldnt matter since phpinfo() says it is not set. This is baffling to me! If I could rip this feature out I would. It was installed by default on my dedicated server.
View Replies !
How Do You Disable The Close (x) On A Window
I'm running a PHP script on page1.php that takes a few seconds, once it has run the page then redirects to page2.php automatically sending variables . However, if the user shuts page1.php by pressing the X on the top right of the screen, the redirect doesn't happen!! Does anyone know how to disable the X and stop the page being closed down please?? or another solution??
View Replies !
How Do I Unclock The URL/disable Frameset?
I have a few websites out there and set up alittle script for my friends to auto register subdomains for their affiliate sites. Problem is, some affiliate programs don't allow URL MASKING and I can not figure out HOW to disable it within the script. Could someone take a look at this and help me? I'm trying to disable the frames in forward.php, along with whatever it gets linked to (i'm very new to this, so i included a link to whole script incase there is more then just forward.php I need to edit). Code:
View Replies !
Disable The Values In Address Bar??
Am trying with a social network site... i want to disable the values in address bar which are passing as string variables, My pages are included in the index page.. and my values are passing like that... by changing the values in address bar my page is changing.. How can i solve this issue... i think anyone can change my site using this address bar.. how could i prevent this???
View Replies !
Disable Right-click On Mouse
Is there a php script that wil disable the right-click on mouse or maybe disable the copy and paste feature of the browser? because i have a client, wherein he wants to prevent public viewing his website from copying his website content?
View Replies !
Disable Anti Aliasing (using Gd Lib)
when I try to disable antialiasing by using a negative value, I get a very ugly pixelized result (tried with Arial, Verdana and a small font). Do you know a better way of disabling anti aliasing? Code:
View Replies !
Disable Browser Caching
Today I'm using: <html> <head> <meta http-equiv = "pragma" content = "no-cache"> </head> This prevent the browser to cache the page. So each time I call the following PHP script: <?php echo date("d.m.Y") . " / " . date("H:i:s") . "<br>"; ?> the current time will be displayed. However, if I call this PHP script over a proxy the time gets not updated. I always have to press Shift + Reload.
View Replies !
Disable Magic_quotes_gpc At Runtime
Unfortunately I have several large sites that depend on magic_quotes_gpc to escape variables. But I now want to start converting these sites slowly so that I can eventually turn magic_quotes_gpc off. The only way I have time to do this is to convert pages one at a time as I work on them so I need to be able to disable magic_quotes_gpc at runtime on only those pages that are converted and ready. This is what I've come up with using an example from this forum and php.net. Does is look like it completely reverses the effects of magic_quotes_gpc? I need this to be fairly rock solid so I don't end up with unexpected data corruption or security problems. Any thoughts... any other rock solid solutions for disabling magic_quotes_gpc on a page by page basis? Code:
View Replies !
Disable Open_basedir For /public_html
Currently I'm getting the "open_basedir Restriction in Effect" error when trying to require a file in this manner: PHP Code: require_once('/includes/folder/file.php'); To avoid the error I have to use a document relative path like this: PHP Code: require_once('../../includes/folder/file.php'); I would like to use the first path because I can reuse such code in different pages in different directories without worrying about the path breaking. How can I disable open_basedir so that the first path will be allowed? Also for safety's sake, if possible I would only like to disable it for the public_html directory and it's child directories etc. So any file in: /home/user/public_html (and it's child directories) Can require any other file in: /home/user/public_html (and it's child directories) I have root access if needed.
View Replies !
Disable Relative Path In Php.ini
As I remember, php has a settings which can disable the PHP codes to open a file like that... <?php echo file_get_contents("../temp/../test.php"); ?> Anyone can confirm is that such a setting?
View Replies !
How To Disable Setting PHPSESSID ?
As I understand my admins installed a PHP server and now my plain HTML pages also want to set a PHPSESSID cookie when loaded into a browser. Can I suppress this, e.g. by creating a configuration file like ..htaccess somewhere in my public_html directory? Is it possible to disable the setting of PHPSESSID cookies for plain HTML pages in general and maybe for PHP pages that don't need to track any session information?
View Replies !
Disable A Checkbox When Another One Is Checked
I am wanting to disable a check box when another one is checked. Here is a screenshot of what I am trying to do. Basically, if the registration fee box is checked I want the online registration box to be disabled (because participants can't pay online from the website).
View Replies !
Compile And Disable Safe_mode
I've tried to compile PHP-4.3.3 for a HORDE installation and it requires that PHP is compiled with safe_mode disabled. I compiled it like this: --disable-safe_mode --enable-safe_mode=no and omitted the line all together and still cannot get it to work because when I run the test that comes with HORDE I still see that safe_mode is not disabled. Any hints on what could be wrong?
View Replies !
Enable Disable Buttons
im making a small virtual shop for my members and ive coded it so tyo buy things they click a standard text link but i want to improve it by making them click a button but i want certain buttons to be disabled if they dont have enough money how do i do this?
View Replies !
Disable Submit Button
I am using a normal submit button, Situation: Once submit is pushed, the computer works. But the user can push the submit again; please advice on how could I “disable� this button once pushed once.
View Replies !
Disable Direct Access
I need some expert opinions on this. I have a link: Code: <a href='#' onclick="javascript:openpage('includes/clients/myfile.php')">Click to open</a> as we can see the file path is includes/clients/myfile.php, i need to disallow users to type the file path into the Url. possible to create a session when a user clicks on a link.
View Replies !
|