Jump to content

Recommended Posts

Hi,

 

trying to run a .php script (on the same server) using a .sh script.

 

I thought it was something like

#!/bin/bash
curl "http://www.domain.com/script.php"

 

but it's saying "curl command not found" - but curl is on the server.. Mental blockage as I've done something similar before - any help?

 

Many thanks

Link to comment
https://forums.phpfreaks.com/topic/172681-mental-blockage/
Share on other sites

There is different switches to wget just as there are different switches to curl. I was posting a simple example.

 

You on the other hand where not giving us all the information needed to help you.

 

Now I suggest you look up the man pages for wget and curl and go from there.

Link to comment
https://forums.phpfreaks.com/topic/172681-mental-blockage/#findComment-910583
Share on other sites

Sounds like you aren't using the absolute path to curl.  Try:

/usr/bin/curl

instead of just curl.

 

The reason for this is since you just a shebang in your script, it isn't importing the PATH variable correctly.  This will fix the "command not found" issue anyways- I'm not getting into whether curl or wget is the best way to do what you're trying to do.

Link to comment
https://forums.phpfreaks.com/topic/172681-mental-blockage/#findComment-914435
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.