user3477071
user3477071

Reputation: 304

Unable to run php script in Ubuntu

I am running Ubuntu 12.04 with these php packages installed: php5, php5-cli and php5-common

The version of php installed is

$ php -v  
PHP 5.3.10-1ubuntu3.25 with Suhosin-Patch (cli) (built: Oct  3 2016 16:53:10)  Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

When I download and run the script

https://github.com/K-S-V/Scripts/blob/master/AdobeHDS.php

using

php AdobeHDS.php --help

I expect to get help on command line switches allowed by the AdobeHDS.php command.

Instead, what I see is html output which is same as contents of the script.

$ php AdobeHDS.php --help > out.html 
$ diff AdobeHDS.php out.html 
$

As per http://forum.videohelp.com/threads/342430-F4F-capturing-converting/page2 the script should recognize the --help switch.

Using any other switch like --manifest also produces similar behavior.

I need help on how to run this script successfully.

Upvotes: 0

Views: 623

Answers (1)

hanshenrik
hanshenrik

Reputation: 21463

best guess, you downloaded the actual HTML file at https://github.com/K-S-V/Scripts/blob/master/AdobeHDS.php , because diff could not find any differences, it means PHP could not find any <?php tag to execute. (the only exception to this would be if the source was a Quine )

the correct way to download your script:

wget https://github.com/K-S-V/Scripts/raw/master/AdobeHDS.php

notice how it has a /raw/ in the url :) it will download this https://github.com/K-S-V/Scripts/raw/master/AdobeHDS.php

also, the HTML code at github, does not actually contain any <?php , it just looks that way when parsed by your web browser, in reality, it's encoded by github as &lt;?php , per https://www.rfc-editor.org/rfc/rfc2629

Upvotes: 3

Related Questions