SitePoint Sponsor

User Tag List

Results 1 to 19 of 19
  1. #1
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP php-5.0.2 installed but GD problem

    Hey have i missed something here ?

    I installed the mentioned realease of PHP but all calls to the GD library are not working.

    Call to undefined function ImageCreate()

    I get the comment above when trying to use the GD library ?


    thanks

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Make sure that the GD library is being loaded by the php.ini. It isn't in a default 5.0.0+ ini file.
    Wayne Luke
    ------------


  3. #3
    SitePoint Zealot shenkong's Avatar
    Join Date
    Sep 2004
    Location
    China
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    open your php.ini , and modify
    PHP Code:
    ;extension=php_gd2.dll 
    to
    PHP Code:
    extension=php_gd2.dll 
    then restart your web server

  4. #4
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    will try that cheers, did uncomment it but never restarted and tried. I will find out when i get home im sure now.

    Cheers

  5. #5
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Unless you run PHP in CGI mode, you have to restart your web server everytime you make a change to php.ini.
    Wayne Luke
    ------------


  6. #6
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well restarted but still get error.

    Unable to load dynamic library './php_gd2.dll' - The specified module could not be found.
    What an earth is up with the install. all was done auto by the install

  7. #7
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Norway
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Copy php_gd2.dll from your php/ext directory to your windows/system32 directory, restart apache again and it should work.

  8. #8
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its IIS im running on.
    And ive been sop dumb. I got the windows installer package of PHP. just this time gone to the site read description and it says no extensions included.

    What do i do now ? how do i get them install them speratley ?

  9. #9
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if i get the normal php, how do i configure every thing to work properly ? what needs doing ? any easy to understand manuals out there ?

  10. #10
    SitePoint Enthusiast
    Join Date
    Mar 2003
    Location
    Brisbane, Australia
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had this same problem just this week, although with php 4.3.9 on my local computer. I uncommented the extension=php_gd2.dll line in php.ini and then it gave me the 'Unable to load dynamic library' error. Turns out there wasn't even an extensions directory in the php directory. What I ended up doing was going to my older version of php and found the extensions directory there - just copied the php_gd2.dll file, created the extensions directory in c:\php and copied the file in the extensions directory. Everything worked fine there.

    It was a little confusing because the GD website state any version of PHP over 4.3.x has inbuilt support for GD which isn't really true now the latest versions don't include any extensions.
    Tips 'n' Tutorials
    Free webmaster tools, code and resources on web design, HTML, Javascript and Internet marketing

  11. #11
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well seem to have manages in from fresh.

    can some one just explain the difference between:
    php-cgi.exe
    php.exe
    php-win.exe

    Im sure the old version was pointed at php.exe but php 5 wouldnt work untill it was directed to php-cgi.

    Thanks

  12. #12
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This is all explained in the extensive Readme that comes with PHP.

    If you do not have the extension DLL's then download the ZIP file and unzip them over your installation directory. The webpage states that the Windows Installer doesn't come with any of the Extensions.
    Wayne Luke
    ------------


  13. #13
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know and if you read further up you'll see I have said daft me for missing that and I got it working. Then the post above yours says I have php 5 working extensions also but I wondered in detail what the difference is between IIS running php.exe over php-cgi.exe for .php files. As PHP 4 auto configured it to run with php.exe but php 5 needs the cgi.exe to work properly.

    Why would they alter ? Only want to understand what is going on ? learn as you go...

  14. #14
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Honestly, wouldn't be able to tell you. I don't recommend running PHP as CGI under any circumstance. I simply use PHP.EXE on my Windows Machine and have both the ISAPI and Apache Module installed for the respective webservers.

    The simple answer though is probably a compile switch. I am pretty sure if you rename PHP-CGI.EXE to PHP.EXE it will still work fine. But since PHP needs to run differently in CGI mode to handle the passing of files from the webserver, it is most likely compiled differently. Under 4.X, they probably did switched internally after compilation. This however would slow down the executable. By moving the switches to the compilation stage, you can get improved performance.
    Wayne Luke
    ------------


  15. #15
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    damn, that means I have to find a way to get it all working with php.exe rather than the cgi then.

    Have tried a few times and the php pages just hang. You have me worried now.

  16. #16
    always learning . . .
    Join Date
    Nov 2003
    Location
    UK
    Posts
    821
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    O your right. renamed the php-cgi.php to php.exe and it works !

    Is this is OK or is it making no difference and still running as CGI ? IIS is my server by the way

  17. #17
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If your webserver is calling PHP.EXE then it is in CGI mode. To use PHP in ISAPI mode, it would call a DLL called phpXisapi.dll, where X is the major version of PHP you are using.

    How to install the ISAPI module is described in the readme file that is distributed with PHP and in the Manual under Windows Installation. You can find the manual at www.php.net.
    Wayne Luke
    ------------


  18. #18
    SitePoint Enthusiast ndtoan13's Avatar
    Join Date
    Dec 2004
    Location
    VietNam
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Why do you said :
    Quote Originally Posted by Hierophant
    I don't recommend running PHP as CGI under any circumstance.
    Somebody said that install PHP as CGi is safer than as modules!

  19. #19
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It is slower and more resource intensive. If are compiling and installing your own PHP, you are on a dedicated server and the security issues of running PHP under a module are non-existant.
    Wayne Luke
    ------------



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •