LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-28-2011, 03:06 AM   #16
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320

First: If you debug your script, you must turn on all warnings and notices:
PHP Code:
error_reporting(E_ALL E_STRICT); 
Second: Turn off "safe mode" if it is enabled.
 
Old 04-28-2011, 03:12 AM   #17
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by eSelix View Post
First: If you debug your script, you must turn on all warnings and notices:
PHP Code:
error_reporting(E_ALL E_STRICT); 
Second: Turn off "safe mode" if it is enabled.
wait. how to debug?
 
Old 04-28-2011, 03:20 AM   #18
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
i tried run script through remote host via ssh host here output
Quote:
Status: 404
Content-type: text/html
X-Powered-By: PHP/4.3.9

No input file specified.

Last edited by athrin; 04-28-2011 at 03:29 AM.
 
Old 04-28-2011, 03:36 AM   #19
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
what is the command you used to run it?

Code:
ssh user@host '/path/to/your/script.sh'
 
Old 04-28-2011, 03:42 AM   #20
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by brownie_cookie View Post
what is the command you used to run it?

Code:
ssh user@host '/path/to/your/script.sh'
sometimes i just run with php regen.php
but i also tried run like this
Code:
ssh phpnewb@myhost.com "php myscript.php"
 
Old 04-28-2011, 08:25 PM   #21
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
Brownie. does the unlink code works for your machine?
 
Old 04-28-2011, 09:21 PM   #22
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
in my error_log it show this
Quote:
PHP Warning: unlink(delete.sh): No such file or directory in /var/www/html/regen.php on line 25, referer: http://localhost/regen.php
what should i do next?
 
Old 05-05-2011, 03:11 AM   #23
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
i have found out that i can remove directory using
Quote:
rmdir
but if i using rmdir it said in error_log permission denied. does anybody know how to allow those permission??

kind regards,
Athrin

Last edited by athrin; 05-05-2011 at 03:14 AM.
 
Old 05-05-2011, 03:37 AM   #24
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
depends with what user you are logged on with, depends on the permission you have on that specific folder with that user, maybe it also depends on who is the owner of that folder, ...

i'm not sure if that are the causes, but it is worth checking
 
Old 05-05-2011, 03:57 AM   #25
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
errr.... i already know how to get permission by adding @ infront rmdir and MAYBE i think it can run
BUT!!!!
now i got this kind of problem.. =,=
Quote:
PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/ssh2.so' - /usr/lib/php4/ssh2.so: cannot open shared object file: No such file or directory in Unknown on line 0
i checked inside /usr/lib/php4/ and ssh2.so not there... +_+
help~

kind regards,
athrin

Last edited by athrin; 05-05-2011 at 04:01 AM.
 
Old 06-20-2011, 01:38 PM   #26
athrin
Member
 
Registered: Mar 2011
Posts: 135

Original Poster
Rep: Reputation: 1
i already solve it.
here my php codes
Code:
if(isset($_GET["delete"]))
{
$ip=$_GET["ip"];
$uname=$_GET["uname"];
$pword=$_GET["pword"];

if($verify=$connection =@ssh2_connect("$ip", 22))
{
@ssh2_auth_password($connection, "$uname", "$pword");
$sftp =@ssh2_sftp($connection);
@ssh2_sftp_unlink($sftp, '/var/www/cgi-bin/testing.sh');
echo "Testing.sh deleted!";
}else
echo"Delete Fail!";
}
thanks guys for your help..

regards,
Athrin
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to delete data from a file with php steve51184 Linux - Server 5 04-28-2011 02:20 AM
How to delete a file with this syntax: index.php\n Procher Linux - Newbie 4 11-07-2009 01:24 PM
delete temp file in linux Arjun123 Linux - Newbie 2 06-24-2009 12:18 AM
Unable to delete files via php on Linux burnham Linux - Newbie 6 05-26-2005 08:56 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration