Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 07:56

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



php shell_exec

Discussion on php shell_exec within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1

 
EEOI's Avatar
 
elite*gold: 50
Join Date: Feb 2010
Posts: 3,038
Received Thanks: 2,519
php shell_exec

Gude,
will eine .sql verwursten, jedoch passiert da releativ wenig, ich wollte shell_exec nutzen.

So sieht mein gebastel aus
PHP Code:
<?php
$password 
'';
$backfisch shell_exec('mysql -u root -p $password newproject_data < newproject_data.sql');
echo 
"<pre>$backfisch</pre>";
?>
Woran liegt das?
bzw. gibt es eine elegantere lösung dafür?

Grüße

Gelöst durch:
PHP Code:
<?php

$password 
'';
$user 'root';


$backfisch shell_exec('mysql --user=$user --password=$password newproject_data < newproject_data.sql');
if (!
$backfisch)
{
    echo 
"Done!";
}

?>
EEOI is offline  
Old 02/10/2015, 01:30   #2
 
.StarSplash's Avatar
 
elite*gold: 74
The Black Market: 185/0/0
Join Date: Jul 2010
Posts: 13,408
Received Thanks: 3,943
Erlaubt dir der Hoster die Funktion überhaupt?
.StarSplash is offline  
Old 02/10/2015, 09:48   #3
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,845
Received Thanks: 4,675
Schonmal ein einfaches echo oder ls mit shell_exec probiert ?
Dann siehst du ja ob du die benötigen Rechte dafür hast oder nicht.
Devsome is offline  
Old 02/10/2015, 12:41   #4

 
EEOI's Avatar
 
elite*gold: 50
Join Date: Feb 2010
Posts: 3,038
Received Thanks: 2,519
Jo mein hoster lässt es zu und bei anderen Sachen funktioniert die Funktion auch ohne Probleme.
Bsp: dir auflisten oder sowas.
EEOI is offline  
Old 02/11/2015, 03:38   #5

 
elite*gold: 0
Join Date: Feb 2008
Posts: 2,754
Received Thanks: 1,748
Hat dein Hoster nicht sowas wie ein PHPMyAdmin-Panel, wo du SQL-Dumps laden kannst?
Computerfreek is offline  
Old 02/12/2015, 22:06   #6

 
EEOI's Avatar
 
elite*gold: 50
Join Date: Feb 2010
Posts: 3,038
Received Thanks: 2,519
Quote:
Originally Posted by Computerfreek View Post
Hat dein Hoster nicht sowas wie ein PHPMyAdmin-Panel, wo du SQL-Dumps laden kannst?
Sowas will ich ja eben selbst schreiben?
EEOI is offline  
Reply


Similar Threads Similar Threads
Frage zu shell_exec
01/22/2014 - Web Development - 4 Replies
Hey, Ich hab da mal eine Frage, wie realisiere ich, dass ich mit shell_exec einen Befehl ausführe, aber diesen dann nach nach einer variabelen Zeit wieder "kill". Es sieht bisher so aus: $time = time() + $_GET; while(1){ $pid = shell_exec('sudo /usr/bin/perl script.pl'); if(time() > $time){
[PHP] shell_exec: sudo: no tty present and no askpass program specified
10/19/2013 - Web Development - 3 Replies
Hey @ all, ich komm gleich mal zur Sache 1. ich möchte, dass mein Script eine shell/batch File executed 2. ich benutze: Linux Debian 6 | Apache2.4 | PHP 5.4.17 3. mein Command $execute_shell=shell_exec('sudo sh /home/usr/scripts/apache.sh 2>&1'); echo $execute_shell; 4. Fehlercode: no tty present and no askpass program specified 5. sudoers: Defaults !requiretty



All times are GMT +1. The time now is 07:56.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.