Not signed in (Sign In)
    • CommentAuthorafrojas
    • CommentTimeSep 15th 2007
     permalink
    I'm extremely new to this and I'm a little confused about certain aspects of apt-get vs compiling from source. Right now I have lighttpd set up and running no problem, I've also installed php5-cgi and got fastcgi working without any problems as well until I realized that there are a few things that the packaged php doesn't offer that I'd like: gd, mcrypt, imap support, things like this.

    So my question is, there are existing php5 packages for these three extensions in particular, but when I install them with apt-get they don't become available in the php cgi. So I'm assuming I need to configure php5, so is there a simple way of configuring/recompiling php5 using apt-get (--with-gd)? Or do I need to build from source? And if I do need to build from source, why are there php5-imap packages?

    Thanks for any help and for understanding my newbie-ness.
    •  
      CommentAuthormatt
    • CommentTimeSep 15th 2007
     permalink

    I’m not familiar enough with the packages, try using “aptitude search PACKAGE” – this might turn up some hits for the packages you are looking for. My gut tells me you’ll probably have to compile though.

    •  
      CommentAuthordyna
    • CommentTimeSep 15th 2007
     permalink
    apt-get install
    GD: php5-gd
    Mcrypt: php5-mcrypt
    IMAP: php5-imap
    So, 'sudo apt-get install php5-gd php5-mcrypt php5-imap' will net you at least the packages you mentioned.
    • CommentAuthorafrojas
    • CommentTimeSep 16th 2007
     permalink
    Hey guys, thanks for your responses.

    I've successfully downloaded the packages already, my problem is that running apt-get install php-5 does not seem to build php with those downloaded extensions configured into it. From what I've read I need to do some ./configure --with-gd and whatever else (depending on the features I'm trying to add).

    So my main question is can I use apt-get or some other thing to easily re-build php5 with these extensions? Or do I need to build from source on my own, without the help of apt-get?

    Thanks!
    • CommentAuthorsfong15
    • CommentTimeNov 16th 2007
     permalink
    I have a related/similar question as afrojas.

    I have 6.06 on a slice, installed php5 but what I got was 5.1.2 but I really want 5.2.x how do I upgrade it or should I 'wget it and compile it on my slice? Has anyone done this before or should I remove php first.
    • CommentAuthortipichris
    • CommentTimeNov 16th 2007
     permalink
    Afrojas

    apt-get installs pre-compiled packages. You do not have to build from source and there is no passing --with-gd to ./configure. There is no using ./configure at all. Install the packages you need and PHP should load the appropriate modules.

    Sfong15

    6.06 is the long term support version of Ubuntu. Packages are stable and tested rather than cutting edge. The current PHP5 package for 6.06 is 5.1.2 I believe. Meanwhile, with Gutsy (7.10) you would get 5.2.3. Grabbing the source and compiling it yourself is probably the best option if you really must have 5.2, but if running the latest software is going to be important to you you'd probably be better off installing 7.10 any way.
    Thankful People: sfong15
  1.  permalink

    I've successfully downloaded the packages already, my problem is that running apt-get install php-5 does not seem to build php with those downloaded extensions configured into it. From what I've read I need to do some ./configure --with-gd and whatever else (depending on the features I'm trying to add).

    How do you know they're not? If you apt-get install php5-gd for instance, it should configure it for you and add it to the extensions section of your php.ini. Make a php file called info.php in your webroot, and put this in it: <? phpinfo(); ?>, then visit yourdomain.com/info.php and check it out. Do the extensions you added with apt-get show up? Then they're installed. Do they not show up? Better check /etc/php5/cgi/php.ini and make sure there's a line that reads extension=whatever.so

  2.  permalink

    Also remember that you need to restart apache after adding php modules. At least, i don’t think that apt does that for you.

    try:

    /etc/init.d/apache2 restart

    Then see if the modules are loaded.

    • CommentAuthorsfong15
    • CommentTimeNov 18th 2007
     permalink
    <blockquote><cite>Posted By: tipichris</cite>

    Sfong15

    6.06 is the long term support version of Ubuntu. Packages are stable and tested rather than cutting edge. The current PHP5 package for 6.06 is 5.1.2 I believe. Meanwhile, with Gutsy (7.10) you would get 5.2.3. Grabbing the source and compiling it yourself is probably the best option if you really must have 5.2, but if running the latest software is going to be important to you you'd probably be better off installing 7.10 any way.<div class="ThankfulPeople">Thankful People:<span><a href="http://forum.slicehost.com/account.php?u=770">sfong15</a></span></div></blockquote>

    Yes default from 6.06 is 5.1.2, I'm at a crossroad. I used 7.10 first then read some tutorials said I better off use 6.06 then I rebuilt. Learn a few new things e.g. pdo extension and pdo_mysql driver are not there in 6.06 I compiled them. Now phpinfo() tells me that I have 5.1.2 not 5.2.x which is required by Habari (a hot alternative to WP).....

    I guess I'll take the rough road removing php then wget...from source and compile. Has anyone done this before in 6.06?
    • CommentAuthorelsid
    • CommentTimeJul 15th 2008
     permalink
    Fyi to anyone wondering why gd doesn't work fully in php. You need to compile php from source, ubuntu's php5-gd package does not contain fully gd support