0
votes
1answer
19 views

Drush commands not found when called from a bash script

Relevant system background: I'm using MAMP on OSX. Output of which php is /Applications/MAMP/bin/php/php5.3.14/bin/php Output of which drush is /Applications/MAMP/bin/php/php5.3.14/bin/drush Output ...
0
votes
1answer
37 views

CentOS 6 - Send user defined command from PHP

I have a web control panel and I need my allow my users to send commands to their application. I a similar problem to SQL injection. $user_input='good command'; shell_exec('tmux send-keys session1:0 ...
0
votes
1answer
32 views

Unable to start bash script with shell_exec

I've been googling and trying to solve this problem with my php script for a few days now and I'm hoping someone here can see the problem I'm missing in getting my php script to kick off my bash ...
1
vote
1answer
117 views

How to execute a php file from a bash file?

My goal is to make a script that I can execute through a cron job. The script needs to find several killstat.php files in multiple directories and execute them. This is what I have so far: ...
0
votes
1answer
261 views

How do I make a shell script that restarts a Java program every x minutes in Linux?

How do I make a script that restarts a java program every X minutes in Linux? I will be using: PHP A linux godaddy hosting account (classic, and I don't know what OS) a .sh script FTP (to access ...
0
votes
2answers
165 views

find out if the server root password is known with php or a bash-script

Is there a way to find out if the shell Ubuntu root password is a certain word? I deliver an image with a full Ubuntu installation to my customers, that has a certain root password. I would like to ...
0
votes
1answer
201 views

Unable to run test.sh file through project.php inside /var/www/

test.sh's path is /var/www/proj/test.sh, and project.php is inside /var/www/ and my test.sh uses and creates some .txt files. when i execute test.sh through terminal it works fine, but when I run ...
1
vote
1answer
261 views

Auto-mount usb flash drivers for remote servers using bash file for scheduled backup operation

I have to do scheduled backup of servers' databases using a cronjob for the backup task and a bash script for the backup operation. It's a PHP web application. You can choose to store your backup file ...
2
votes
1answer
910 views

Nice commands in a .sh script for cron jobs

I have this php script that I need to run on shared webhosting. I have created a cron job that executes an sh script. The command for the cron was: /bin/sh /home/user/script.sh So I'm assuming it is ...
2
votes
1answer
289 views

Weird file truncation issue in CIFS mount

With reference to: http://stackoverflow.com/questions/12211629/php-file-put-contents-not-truncating-file-in-cifs-mount We have a Seagate BlackArmor NAS device, which is mounted on our Ubuntu 10.04 ...
6
votes
2answers
14k views

PHP script can't run bash script. sh: Permission denied

I'm trying to exec a .sh script from PHP, however it is not executing. I checked the error logs, and I'm getting the 'sh: Permission denied' error. I checked under which user php is being run, and ...
0
votes
3answers
249 views

Windows batch command equivalent for these PHP and Bash commands

What are the equivalent commands in Windows if I have these commands in Linux? if (!is_dir('geoip')) mkdir('geoip', 0744); shell_exec('unzip -oj GeoLiteCity.zip -d geoip/'); shell_exec('rm -rf ...
0
votes
2answers
187 views

PHP crazy behavior on mount

I have a mount to my windows machine on a linux machine. When I try to run any php scripts there it says it's not found, however, when i copy the files to the local storage it runs with no problem. I ...
0
votes
1answer
906 views

Give permissions to www-data user to run a local script

I actually try to launch a gnome-terminal with a PHP script, and seems I have some problems with the users www-data; My script only makes an ls -l command in a directory (is just for a test) and I ...
1
vote
1answer
1k views

“php: command not found” after changing PHP system files in OS X

I wanted to install Symfony on Mac OS X Lion. Apparently, as MAMP was already installed on my computer, there was a problem with the "timezone" field in the php.ini file. I can't remember exactly the ...
2
votes
1answer
332 views

how to debug PHP script in bash

Can someone tell me the best way to run a PHP script and output content and errors to a text file (using nohup) using the unix shell?
1
vote
2answers
963 views

Debian: Kill a Screen session through the web

I have php code that is as follows (kill.php): <?php echo exec("/home/duke/aa/scripts/test.sh"); ?> test.sh looks like this: screen -S server -X quit If I run the php code in the terminal ...
1
vote
2answers
1k views

Crontab + .sh + php

I'm trying to call a shell script every 5 minutes, witch executes php file under root. # crontab -l */5 * * * * /home/regularuser/call.sh permissions: -rw-rw-rw- 1 root root 162 Jun 6 ...
0
votes
2answers
2k views

Mac OS X bash: uninstall all apache and PHP occurences

How do I find all installed apache and PHP occurences on a Mac OS X system in bash and uninstall them? My motivation: I've managed to install multiple apache and PHP packages (I believe it's called ...