Category talk:J: Difference between revisions

(→‎GeSHi Highlighter for J: Well, here are some troubleshooting suggestions.)
(→‎GeSHi Highlighter for J: possible cause.)
Line 60:
:::::: When/if I get it to work I'll give it a shot, however my first try didn't work out. My understanding from the instructions above, was that I should be able to get PHP/GeSHi to process files without necessarily setting it up in conjunction with a web server. I downloaded the Windows binary for PHP, installed it using the default parameters, except I didn't pick any web server to configure it for. I downloaded GeSHi and extracted it to a folder. I created the <code>testgeshi.php</code> file in the same folder as the <code>geshi.php</code> file and copied my <code>j.php</code> file to <code>geshi\j.php</code> with the other language files. I then started a <code>cmd</code> session, made the folder containing <code>testgeshi.php</code> the current directory and then ran <code>php testgeshi.php > mytest.html</code>. The <code>mytest.html</code> is created but it is zero-length. The folder containing the php binaries (exe and dll) was added to the path by the PHP installer. Any suggestions?--[[User:Tikkanz|Tikkanz]] 21:22, 11 November 2009 (UTC)
::::::: It sounds like you did everything right; in particular, I can verify that you shouldn't need to deal with any Web servers. It's bizarre that you got no output at all, instead of, say, an error message at the very least. Possibly the culprit is that Windows doesn't have a real standard error stream; I really have no idea how <code>cmd.exe</code> works. Try a skeletal PHP script (<code>&lt;?php echo 'Hello, world!'; ?&gt;</code>) to verify that PHP is working; try highlighting a C program (with <code>$language = 'c';</code>) to verify that GeSHi is working; try running <code>php testgeshi.php</code> without redirecting to a file. Sorry if this doesn't help much; it's hard to debug this kind of thing through an asynchronous medium. Worse comes to worse, we could try meeting on IRC this weekend. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 23:09, 11 November 2009 (UTC)
:::::::: In production PHP setups, error output is supposed to be disabled, to avoid tipping off malicious visitors about the internal organization of a site. I believe current versions of MediaWiki disable error output by default. See [http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting ini.error-reporting]. --[[User:Short Circuit|Michael Mol]] 02:42, 12 November 2009 (UTC)