Executing remote php file gives "No such file or directory" error

Advertisement

johnywhy
Joined:
Posts:
11
Location:
Bay Area

Executing remote php file gives "No such file or directory" error

Executing mediawiki rebuildall.php
See screenshot attached

Gives error:
Command '"./rebuildall.php"'
failed with return code 2 and error message
./rebuildall.php: line 1: ?php: No such file or directory
./rebuildall.php: line 2: /CmdTool.log: Permission denied
./rebuildall.php: line 3: 7zip.inc: command not found
./rebuildall.php: line 4: 7zip.inc: command not found
./rebuildall.php: line 5: 7zip.inc: command not found
./rebuildall.php: line 6: 7zip.inc: command not found
./rebuildall.php: line 6: you: command not found
./rebuildall.php: line 7: 7zip.inc: command not found
./rebuildall.php: line 8: 7zip.inc: command not found
./rebuildall.php: line 8: either: command not found
./rebuildall.php: line 9: syntax error near unexpected token `at'
./rebuildall.php: line 9: ` * (at your option) any later version.'.

Screenshot (3).jpg

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,469
Location:
Prague, Czechia

Re: Executing remote php file gives "No such file or directory" error

If you want to execute a script file directly, it has to have "Shebang" line:
https://en.wikipedia.org/wiki/Shebang_(Unix)
As your file script does not have one, you have to execute it by explicitly running a script interpreter.

You should really read MediWiki documentation:
https://www.mediawiki.org/wiki/Manual:Rebuildall.php#Usage

cd /path/to/wiki/maintenance
/path/to/php rebuildall.php

Reply with quote

Advertisement

You can post new topics in this forum