Forums
IIS interaction with GD, ImageMagick, and php libraries
This post has been placed on Xoops and Peak.ne.jp/xoops but no response, so further to a message from Brash I'm slapping it in here too.
This problem relates to my Intranet site at work, not my personnal site. I have used MyAlbum on the site for a while, and it's got about 50 or so pictures on it and it has always worked great. I then updated to Xoops 2.0.9.2, and since then I get errors as described below. Read on and it will all make sense.
I have tried some steps:
Firslty, the problem :
<br /> PHP Fatal error: Call to undefined function: imagecreatefromjpeg() in d:\cms.fct\modules\myalbum\include\functions.php on line 292<br />
and the URL link goes to :
<br /> http://fct.local/modules/myalbum/submit.php?caller=<br />
Secondly, my setup
<br /> Windows Server 2003<br /> php 4.3.6 (I think, although it could be 4.3.1)<br /> MySQL 4.0.20<br /> IIS 6<br /> Xoops 2.0.9.2<br /> MyAlbum 2.83<br /> NewBB2<br />
Thirdly, the countermeasures taken to resolve this frustrating problem (other than those described above) :
1) Installed ImageMagick, restrated the web publishing service, and rebooted the server. ImageMagick not detected still by Xoops modules, namely MyAlbum and NewBB2 (I still don't know what path to specify for ImageMagick on a Windows Server?).
2) Having been told to read this post at psychostats.com by Predator (in relation to NewBB) I checked that I had the php_gd2.dll library in my php\extensions folder, which I have. Also, updated this file by downloading the full windows binary from php.net because apparently the standard windows installer does not include it.
3) Edited my php.ini file as follows :
a) Checked the extension_dir path did equaled c:\php\extensions. It did.
b) Removed the ; prior to extension=php_gd2.dll
and re-started the web publishing service again.
No joy. In fact, my Intranet site was then innaccessible and users just got 'Page Cannot Be Displayed' errors after a long wait. Every attempted access resulted in an error message being displayed on the server saying 'Unable to load extension php_gd2.dll' or something similar.
So I turned the php.ini file back to how it was and re-started the web publishing service again. Now I can access the site again (thank the lord) but my orginal problem still persists - MyAlbum still cannot receive new graphics, ImageMagick is not detected by either MyAlbum or NewBB2 (although this may be because I don't know what path to specify in the setup for a windows server).
My questions then are these :
1) Could it be an IIS issue?
2) Do I need to tell IIS to use the library as well as php?
3) If so, how?
4) If it isn't an IIS issue, what else could it be?
5) What path do I specify in the preferences of MyAlbum to get it to use ImageMagick (loads of entries about Apache and Linux paths but none for windows)
Is there anything else that may be causing the problem?
Thanks, as always
Ted
- Add new comment
- 15821 reads
I'm assuming c:\php\extensions is the actual path to your PHP extensions directory? Have you granted the IUSR_
Can you create a new file (call it phpinfo.php or something) and copy the following code to it;
<br /> <div class="codeblock"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// Show all information, defaults to INFO_ALL<br /><br /><br /><br /></span><span style="color: #0000BB">phpinfo</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span></span></code></div><br />
Place the file in your website root folder, and then access it through your Internet browser. Is the GD library listed as loaded?
You might aslo want to enable error logging in your php.ini file as well.
I've just double check my IIS 5.1 test machine, and I have done the same as you. Set the extensions directory and uncommented the gd2 dll file in php.ini. I have 3 Xoops 2.0.9.2 sites running without a problem off this machine.
My recommendation would be to try again, but this time make sure you turn on logging in php.ini. Are you running PHP in ISAPI mode, or CGI?
Straight CGI isn't very efficient or as secure as ISAPI with IIS. The main disadvantages are that CGI requires you to open up NTFS permissions a bit in order to run making it less secure, and CGI is less efficient as the CGI EXE is being executed and terminated for each requests it gets making it slow and memory intensive. ISAPI on the other hand is loaded into memory once, and as it operates as a regular DLL file does not require changes to NTFS permissions.
tedsmith wrote:1) I'm using CGI and not ISAPI. Every time I tell IIS to use ISAPI I get white pages, despite permissions for IIS and IUSR being allocated to the php folder and sub-folders. I don't know why - I follow the instructions (as stated in the Sitepoint book) to the letter, but no joy with Xoops.
We could very easily get bogged down in this. Have you read the PHP installation guide over at www.iis-resources.com ? Easiier still is to just use John Lim's PHP Easy Windows Installer. Do this first and we'll take it from there.


Location: Melbourne, Australia
Joined: Sep 2003