Zikko's Resources
- 3D to 2D projection - like in the good old days
- Extracting text from PDF files with PHP
- GetJPGInfo - retrieving type, width and height from a JPG image with ASP/VB
- Extended ActionScript Date methods : getWeek() and getDayOfYear()
- Getting the intersection point of two straight lines with Actionscript
- pdf2jpg - Converting PDF to JPG with Photoshop Scripting
- Counting the pages of a PDF document with PHP
- Client-server communication with Flash : Common pitfalls
- Unable to Fork - Running PHP exec/system on IIS
Unable to Fork - Running PHP exec/system on IIS
It's been discussed a thousand times I guess, usually in too much detail, so I'll keep it short here. PHP has a couple of ways to execute code as if it was done from a DOS window, such as exec, system and passthru. These commands have little differences, see the PHP docs for details. However, they are all known to fail mysteriously when run on IIS servers.
But why?
This has to do with the permission settings of a little program called cmd.exe or something like that. And it's just the little "something like that" that is the confusing bit. The name and the path of it is different in different environments and operative systems, and so is the system name of your computer which is also needed to put things right. So - here's a little code snippet that retrieves those things from the environment so you don't have to worry about it, and sets the neccessary permissions. You need to run it from commandline, and only once.
The shit
cacls %COMSPEC% /E /G %COMPUTERNAME%\IUSR_%COMPUTERNAME%:R
All content on these pages may be used, copied and modifed freely. Questions or comments may be sent to . Also visit zikko.se.