Closed paulzim closed 5 years ago
What does this show:
ls -la `which pandoc`
ls: cannot access 'which pandoc': No such file or directory
Maybe I need to process in another directory?
Be sure to use back tic's around which pandoc, not single quotes. Equally you can do to steps:
which pandoc
take the output of that and do:
ls -la /usr/local/bin/pandoc
Changing /usr/local/bin/pandoc for the path you got.
Ah, I see where the problem is... it's choking on the program location:
which pandoc
/c/Program Files/Pandoc/pandoc
pzimmerm@PZIMMERM-M6P2G MINGW64 ~/Documents/GitHub/mediawiki-to-gfm (master)
$ ls -la /c/Program Files/Pandoc/pandoc
ls: cannot access '/c/Program': No such file or directory
ls: cannot access 'Files/Pandoc/pandoc': No such file or directory
pzimmerm@PZIMMERM-M6P2G MINGW64 ~/Documents/GitHub/mediawiki-to-gfm (master)
$ ls -la `which pandoc`
ls: cannot access '/c/Program': No such file or directory
ls: cannot access 'Files/Pandoc/pandoc': No such file or directory
I tried to reinstall Pandoc but it's not letting me change the location
Any suggestions would be appreciated!
OK, I fixed the Program Files issue... I was able to reinstall in another location, but I'm still getting the same error... not sure why now...
pzimmerm@PZIMMERM-M6P2G MINGW64 ~/Documents/GitHub/mediawiki-to-gfm (master)
$ ./convert.php --filename=C:\Users\pzimmerm\Documents\Pandoc\DocWiki-20190103183530 --output=C:\Users\pzimmerm\Documents\Pandoc\Converted
Pandoc executable is not executable
pzimmerm@PZIMMERM-M6P2G MINGW64 ~/Documents/GitHub/mediawiki-to-gfm (master)
$ ls -la `which pandoc`
-rwxr-xr-x 1 pzimmerm 1049089 133869130 Nov 26 08:12 /c/pandoc*
Not on Windows here so a bit tough to figure out. If we look at the Pandoc code, this is where that error comes from:
if ( ! is_executable($this->executable)) {
throw new PandocException('Pandoc executable is not executable');
}
Can PHP execute Pandoc in the location you have it store? I've seen a reference somewhere that the folder Pandoc is in must have proper permissions for PHP to be able to run Pandoc. Though I am unsure of those permissions for Windows. Not much, but hopefully this will help you find a solution.
OK, thanks... I'm having a Mac person on my team try it out. I really appreciate all your help... and I hope this works, it would save a bunch of time!!
If you figure out, please post your solution, in case it is helpful to others.
Will do!
We got it to work on a Mac with a couple of issues:
A couple of notes on running this on Mac:
I had to run php composer update --no-dev
rather than composer update --no-dev
.
I had to upgrade my pandoc install from 1.19.2.1 to 2.5 to get the PHP script to run.
I get a "Pandoc executable is not executable" error, but Pandoc is working fine. Not sure what to do from here.