#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    3
    Rep Power
    0
    I tried to install PHP 4.0.0 and then PHP-3.0.16 but failed both the times. I am working on i386/ Caldera Linux 2.2.14
    My apache server (1.3.11) is working alright.
    I tried both the rpm and gz install packages.

    Here's what I did:
    # gunzip -c php-4.0.x.tar.gz | tar xf -
    # cd php-4.0.x
    #./configure --with-mysql
    --with-xml --with-apache=../apache-1.3.11 --enable-track-vars

    I got this from one of the articles at devshed.

    Does someone have any info about how to install php4.0 or 3.0 to work with Apache and MySql?
    Thanks

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    33
    Rep Power
    15
    Hi!
    I just installed PHP 4.0 and Apache on WinLinux (it's a Slackware-based distribution) and it went all right. First of all, after you followed those instructions, you should have run ./configure in the apache dir (which in your case is in the same folder as php). The configure should be run with --prefix=PATH parameter (but it's not required) and -this is important- --with-php-something (I don't remember, it's something about the yet unexistant php.h script - DO CHECK the INSTALL document in the php dir). After you make and make install the apache, you need to change into the apache dir (/usr/local/apache by default), go to conf dir and change the httpd.conf as indicated in the INSTALL doc from the PHP dir. Also you may uncomment the server location (127.1.1.1 or something is default, change to 'localhost' to remember more easily). Change into bin (../bin), run apachectl start. Fire up Netscape, type localhost/path-to-your-script.php(3 - for php 3). The script should exist in your htdocs dir under /usr/local/apache).

    The best you can do is just follow all the directions in the PHP install documentation supplied with the package .tar.gz.

    Good luck!
    Stas
  4. #3
  5. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    You have the correct configuration for PHP, but you also need to configure and recompile Apache.

    The best thing is to uninstall Apache, then download the source to Apache 1.3.12.

    (1)Unzip and untar Apache, cd into its directory, type ./configure

    (2) cd into PHP directory,

    #./configure --with-mysql
    --with-xml --with-apache=../apache-1.3.11 --enable-track-vars
    # make
    # make install

    (3) cd back to Apache directory (Now you will recofigure and compile). Enter # ./configure --activate-module=src/modules/php4/libphp4.a (and any other configuration options you want)
    # make
    # make install

    That should do it ;-)

    P.S. I noticed someone (above) was answering at the same time I was. He is right about fixing the httpd.conf file (uncomment the Loadmodule line for PHP, search for and uncomment other lines related to php, and add .php to the DirectoryIndex list), but you must follow the order I describe above first.

    [This message has been edited by rycamor (edited May 28, 2000).]
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>I tried to install PHP 4.0.0 and then PHP-3.0.16 but failed both the times.

    If Apache already installed, please go to: http://www.devshed.com/Talk/Forums/F...ML/000020.html and add --with-xml when installing PHP.

    DO NOT SPECIFY --with-apache in this case.

    >>but you also need to configure and recompile Apache.
    This is not the case any longer with '--with-apxs'.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    3
    Rep Power
    0
    Thanks for replying to my query. I tried it again but I get an error when I execute the "make" command.
    The error is
    Makefile:34: /build/rules.mk: No such file or directory
    Makefile:35: /build/library.mk: No such file or directory
    Makefile:36: /build/program.mk: No such file or directory
    make: *** No rule to make target `/build/program.mk'.

    Incidentally when I ./configure the php-4.0.0 then I do not get any file by the name of Makefile. Instead I get Makefile.in
    the make command doesn't work with this setup. SO I copied Makefile.in to Makefile and then tried "make" which resulted in the error above.

    Thanks in advance if you have any suggestion.
  10. #6
  11. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Makefile:34: /build/rules.mk: No such file or directory
    >>Makefile:35: /build/library.mk: No such file or directory
    >>Makefile:36: /build/program.mk: No such file or directory

    If you cd to /build directory, can you see those files?

    Okay, once again.
    1) tar -zxvf php-4.0.0.tar.gz
    when you run this, /build and its contents are the very first directory that get uncompressed.

    2) cd php-4.0.0
    Make sure you cd to php-4.0.0, if you don't, of course /build will not be found.

    3) Run ./configure, then a Makefile will be created. Never copy Makefile.in to Makefile yourself.

    Please go back to http://www.devshed.com/Talk/Forums/F...ML/000020.html and follow instructions carefully.
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    3
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by freebsd:
    >>Makefile:34: /build/rules.mk: No such file or directory
    >>Makefile:35: /build/library.mk: No such file or directory
    >>Makefile:36: /build/program.mk: No such file or directory

    If you cd to /build directory, can you see those files?

    Okay, once again.
    1) tar -zxvf php-4.0.0.tar.gz
    when you run this, /build and its contents are the very first directory that get uncompressed.

    2) cd php-4.0.0
    Make sure you cd to php-4.0.0, if you don't, of course /build will not be found.

    3) Run ./configure, then a Makefile will be created. Never copy Makefile.in to Makefile yourself.

    Please go back to http://www.devshed.com/Talk/Forums/F...ML/000020.html and follow instructions carefully.
    [/quote]

    Hi freedbsd,
    Thanks for your tip. Earlier I had placed the tar file in tmp/download
    I moved it out and then executed the steps. Now I was able to make, make install and configure.
    Is there a commandline test to check whether php is working with apache? I tried a test script but that is not working.
    Thanks
  14. #8
  15. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>I tried a test script but that is not working.
    Try this:
    #test.php4 (with just a single line in it)
    <? echo "Hello World"; ?>

    place it in your public_html directory. If it prints just:
    Hello World
    then it's working.
    If it prompts you with a "save as" window, then you forgot the "step 13" at http://www.devshed.com/Talk/Forums/F...ML/000020.html
    If it prints:
    <? echo "Hello World"; ?>
    check "step 11" and "step 12"
  16. #9
  17. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    Also a good test script:

    <? phpinfo(); ?>

    outputs a whole page detailing the configuration of PHP, apache and any other modules.

    freebsd: Yes I see, -apxs does not require a recompile of Apache. Any thoughts on whether Apache is any more efficient with the compile method instead of the loadable module method?
  18. #10
  19. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Any thoughts on whether Apache is any more efficient with the compile method

    Yes technically but not significantly. For fresh install, it's better to go with compile method if one has no plan to add additional modules. There are just plenty of new born modules out there in this fast-pace-changing internet world. It's a pain to recompile over and over again for each additional modules.

    Further, I supposed this is more like a newbie forum and most of us have the mind of experiencing something or test-drive something new to them far more than wanting to run something alone permanently. I suggest the apxs method over the compile method so they can install additional modules like: mod_perl, mod_jserv, mod_dtcl, mod_python, mod_frontpage and etc in an eaiser way.

Similar Threads

  1. Apache 2 and PHP 4
    By stanley1610 in forum Apache Development
    Replies: 2
    Last Post: February 12th, 2004, 09:20 PM
  2. php for apache
    By wannabe in forum Beginner Programming
    Replies: 3
    Last Post: February 6th, 2004, 03:28 PM
  3. Fixing a partial install on FreeBSD
    By samuelelliot in forum BSD Help
    Replies: 2
    Last Post: January 31st, 2004, 10:11 PM
  4. PHP -> system commands
    By Tantalus in forum PHP Development
    Replies: 1
    Last Post: January 28th, 2004, 11:51 AM
  5. Can PHP interpret Apache Directory Protection?
    By xpatriot in forum PHP Development
    Replies: 1
    Last Post: January 25th, 2004, 02:51 PM

IMN logo majestic logo threadwatch logo seochat tools logo