Trying to run 'install.sh' on server

  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

Can someone provide me with some info on how this is done?

I have a remote server that I ftp a file called install.sh that I am suppose to run that will display some steps. I also set the permissions to 755. I couldn't find a solution in my hosting control panel.

How do I run this file?

I've been trying to use a php script with system(), shell_exec(), exec() commands but nothing works. I just get a blank page. The install.sh should take me through a stepwise process so I don't know how to send that back with php or if the process should begin automatically in the browser window by just calling the execute command.

Can I get some steps on anything I need to download or get my hosting company to change to get this to work?

The install.sh file is a /bin/bash file.
#!/bin/bash
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Don2007
  • Web Master
  • Web Master
  • Don2007
  • Posts: 4924
  • Loc: NY

Post 3+ Months Ago

Try sh install.sh
  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

still nothing, just a blank page.

shell_exec('sh install.sh');


The file is set to 755 or 777. I've done both.

Is there's anything additional my hosting company could have done to prevent this? If so, can I bypass it with a .htaccess file in the same directory or what do I need to tell them to change?

thnx.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

What does the first line of the shell script look like? It will indicate which shell type the script was written for.
  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

#!/bin/bash
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

I'm assuming you don't have direct shell access to the account and that's why you're using PHP.

Try these:

Code: [ Select ]
. install.sh

Code: [ Select ]
./install.sh

Code: [ Select ]
bash install.sh
  • devilwood
  • Silver Member
  • Silver Member
  • User avatar
  • Posts: 436

Post 3+ Months Ago

That's right. I've not used ssh a whole lot. I actually use it to connect sometimes to my personal server with no problems, but everytime I try to use with a major production server from a hosting company I can never connect. I'm sure it's just a user/permission thing, but to get all that information together usually runs me into more locked doors and a real pain in my neck.

The install.sh just unpacks some files so my roommate started doing it manually. I'll try to setup a test file.

What would have been my next step if those 3 tries didn't work either? That way if I run into this problem again I can try those and move onto the next step. Thnx a ton spork.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 116 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.