Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP - youtube-dl: command not found #11967

Closed
clarityworld opened this issue Feb 4, 2017 · 6 comments
Closed

PHP - youtube-dl: command not found #11967

clarityworld opened this issue Feb 4, 2017 · 6 comments

Comments

@clarityworld
Copy link

@clarityworld clarityworld commented Feb 4, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.02.01. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • [X ] I've verified and I assure that I'm running youtube-dl 2017.02.01

Before submitting an issue make sure you have:

  • [ X] At least skimmed through README and most notably FAQ and BUGS sections
  • [ X] Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • [ X] Other

Hello!
I'm trying to run youtube-dl via PHP. It's all working when im logged in on Terminal.
When I try to run via exec, I get this Eerror:"sh: youtube-dl: command not found"
My Php
<?php $cmd = 'youtube-dl https://www.youtube.com/watch?v=jRpp--g3oNY'; exec($cmd." 2>&1", $output); echo "<pre>"; var_dump($output); echo "</pre>"; ?>

array(1) {
[0]=>
string(33) "sh: youtube-dl: command not found"
}

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 4, 2017

Most likely $PATH is not correctly set. You may want to use absolute paths.

@yan12125 yan12125 closed this Feb 4, 2017
@clarityworld
Copy link
Author

@clarityworld clarityworld commented Feb 4, 2017

Dare to explain a little more. I don't know. $PATH is something server side ,or in the php file?

@clarityworld
Copy link
Author

@clarityworld clarityworld commented Feb 4, 2017

Added:
putenv('PATH=/usr/local/bin');
Now
string(47) "/usr/bin/env: python: No such file or directory"

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Feb 4, 2017

putenv is the correct way, but /usr/local/bin is not enough. /usr/local/bin:/usr/bin should work I guess.

@clarityworld
Copy link
Author

@clarityworld clarityworld commented Feb 4, 2017

Thank you !

@QianMuXiao
Copy link

@QianMuXiao QianMuXiao commented Jul 11, 2020

youtube-dl install successfully
but when I type youtube-dl -H
it just shows
zsh: command not found: youtube-dl

@ytdl-org ytdl-org locked and limited conversation to collaborators Jul 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.