0
all right? See if anyone has been through this, I’m with this simple code in shellscript, which access folder (/home/test4toquew5824) and then confirm if I entered the directory with pwd,
#!/bin/bash
cd /home/teste4toquew5824 && pwd
and I have a php file (located in /var/www/html) that calls this sh:
$retorno = shell_exec('/usr/local/bin/api/teste.sh');
echo "<br><br>";
var_dump($retorno);
When I get the pwd return it shows as if it is still in the php file directory (/var/www/html), i.e., it is not "accepting" or running the cd command.
1 - I’ve already applied permissions for php and sh.
2 - I have confirmed the directory /home/teste4toquew5824 exists
3 - I already tested and placed an echo inside sh just to confirm that php is calling and running sh correctly.
4 - I have already put in sh a line to copy a file just to be sure that another command is running too and copied the file to /var/www/html
Anybody got any ideas? Thank you very much
Change the shebang from the script of
#!/bin/bash
for#!/bin/sh -
.Bash does not acceptpwd
.– Augusto Vasques
I switched here, even though it didn’t happen :( It doesn’t seem to be entering the folder
– Petronio Amaral