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

occ failes as cli #15054

Closed
guennti opened this issue Mar 20, 2015 · 6 comments
Closed

occ failes as cli #15054

guennti opened this issue Mar 20, 2015 · 6 comments

Comments

@guennti
Copy link

guennti commented Mar 20, 2015

occ failes in cli with "This script can be run from the command line only"

I have installed oc 7.0.5 on my webspace hosted at Strato.
Now I would like to convert the db to mysql but the occ failed.

Before that I had the problem:
PHP Notice: Undefined index: SCRIPT_FILENAME in /htdocs/owncloud/lib/base.php on line 107
PHP Notice: Undefined index: SCRIPT_NAME in /htdocs/owncloud/lib/private/request.php on line 196
as workaround I defined the variables by editing occ with:
$_SERVER["SCRIPT_FILENAME"] = "/htdocs/owncloud/occ";
$_SERVER["SCRIPT_NAME"] = "/occ";

It looks like the cli recognition in lib/base.php failed, but I don't know why.

@RobinMcCorkell
Copy link
Member

@guennti Could you post your PHP version and OS version (if you know it)? Also, is php a symlink to php-cli or a different binary? In addition, could you use php -a to run:

print(php_sapi_name());

And see what is output? For reference, we are expecting that string to be 'cli'.

@guennti
Copy link
Author

guennti commented Mar 20, 2015

Versions are:
X-Powered-By: PHP/5.5.18
'HOSTTYPE' => 'i86pc', 'VENDOR' => 'sun', 'OSTYPE' => 'solaris', 'MACHTYPE' => 'i386'

In php -a output (closed this with ctrl-d) (I am not familiar with php, sorry)
php -a
Interactive mode enabled
print(php_sapi_name());
X-Powered-By: PHP/5.5.18
Content-type: text/html

php-cli does not exist, the php is:
--wx--x--x 1 0 1 15736 May 12 2014 /bin/php

@RobinMcCorkell
Copy link
Member

Hmm, that's not the output we were expecting. More OS-specified stuff... any ideas @DeepDiver1975 @PVince81 ?

@DeepDiver1975
Copy link
Member

my webspace hosted at Strato.

@guennti please ask the Strato support why php_sapi_name() is not properly returning 'cli'.
This is mostly because of some hosting specific compilation/configuration Kung-Fu-

THX

@guennti
Copy link
Author

guennti commented Mar 20, 2015

@DeepDiver1975 I send a request to Strato support, but don't really expect a helpful answer.
I will be back on this.

THX

@DeepDiver1975
Copy link
Member

dulicate

@MorrisJobke MorrisJobke removed this from the backlog milestone Mar 23, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants