SitePoint Sponsor

User Tag List

Results 1 to 25 of 25
  1. #1
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Glitch installing PHP 4.0

    After many frustrating attempts to install MySQL, Apache and PHP on Redhat 7.1 from rpms, I have installed them following Julie Meloni's very clear instructions in her book "PHP: Fast & Easy Web Development." All went very smoothly until the very last step.

    Last step is to create a file called phpinfo.php in the Apache 1.3.12 htdocs directory. The page contents are <? phpinfo(); ?>. Trying to access it via Netscape browser at http://localhost/phpinfo.php., instead of the page of system and environment information, I get a dialog box "Save As..(type application/x-httpd-php), Filter: /home/paulcj2/*.php, Directories: various, Selection: /home/paulcj2/phpinfo.php. Apparently my machine thinks I am trying to save something from my user home directory. Thinking it might be a permission problem, I tried it both as user and as root. Did the same both times. I don't get this at all.

    I did configure Apapahe, according to instructions, to use PHP4 by uncommenting the following lines:

    AddType application/x-httpd-php .phtml .php
    AddType application/x-httpd-php-source .phps

    Looks like there needs to be some other configuration change, but I don't have a clue. Can anyone help?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you restart apache?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP installation glitch

    Yes.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Forgivem e because I hgave not read Julie Meloni's book, but I have never been able to get them all working together from RPMs. I always compile all of the from their source so I can scustomize each piece as I see fit. Did the RPM know to add the LoadModule and AddModule lines to hte httpd.conf file? You should see one like

    LoadModule php4_module libexec/libphp4.so

    and one like

    AddModule mod_php4.c


    I don't know how the RPMs would work since in order to compile PHP as a dynamic module in Apache you need to use Apache's APXS.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP glitch

    I went to her book because I gave up on rpms on your suggestion. I built them from source code on the cd supplied.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  6. #6
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP glitch

    I am following up on your suggestions and will get back to you.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  7. #7
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP installation glitch

    Wow! No "LoadModule php4_module libexec/libphp4.so"!!!!

    So much for that book.

    I added the line, but Apache still didn't like it, coming up with the message "Cannot load .../libexec/libphpr.so into server. No such file or directory. httpd could not be started."

    I checked to see if libexec does exist and it does. However, it has only one file in it - httpd.exp.

    I guess I'll bite the bullet and start afresh downloading the source code directly from the web and use Kevin's installation procedure in his Database Driven Websites article.

    Thanks for your kind response.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  8. #8
    SitePoint Evangelist CyberFuture's Avatar
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you install PHP as a binary file or did you compile it yourself. If you compided the code your final command should look something like this:

    ./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql

    In theory at least. It sounds like you didn't complile PHP4 as a module which is why there was no LoadModule and file was missing.

  9. #9
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CyberFuture read his first post he installed all of them from RPMs.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  10. #10
    SitePoint Evangelist CyberFuture's Avatar
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He said:

    I went to her book because I gave up on rpms on your suggestion. I built them from source code on the cd supplied.

  11. #11
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess I missed that post, sorry
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  12. #12
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Building Apache, MySQL and PHP

    All right, here we go. This AM I downloaded source code: apache_1.3.20.tar.gz, mysql-3.23.42.tar.gz and php-4.0.6.tar.gz. My goal is to get them to play nicely together within Linux Redhat 7.1.

    Starting with Apache I gunzipped and tarred it in /usr/local. So now, within the folder apache_1.3.20 I am preparing to build apache. I have searched the documentation and have read your suggestions about how to enter ./configure. Still not sure how exactly to proceed. Here are the options I am looking at.

    1. ./configure

    2. ./configure --prefix=/usr/local/apache-1.3.20 --enable-module=so

    3. ./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql

    Here is my thinking at this point interspersed with questions:

    If I do just ./configure, I understand apache will not know where to install itself, will not build modules dynamically (thus requiring apache to be rebuilt if I change a module), and will not use the utility apxs.

    Even after reading docs am not sure how apaxs relates to MySQL and/or PHP 4.0.

    Not sure where in this come the instructions to complile PHP4 as a module.

    So, with limited understanding, I am planning on adding the following to ./configure:

    1. --prefix=/usr/local/apache_1.3.20
    2. --enable-module=so
    3. --with-apxs=/usr/local/apache/bin/apxs

    Shouldn't the above "apache" be "apache_1.3.20" in my case?

    4. --with-mysql=/usr/local/mysql

    In view of the above, should I install MySQL first?

    Is there anything else I need to add or do differently to my apache ./configure step to get Apache, MySQL and PHP to cooperate?

    This will be about my 6th try, so I'd love to get it right this time. Thanks for your patience.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  13. #13
    SitePoint Evangelist CyberFuture's Avatar
    Join Date
    May 2001
    Location
    San Diego, CA
    Posts
    434
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Order of installation should be:

    1- Apache
    2- MySQL
    3- PHP4

    At least that was how I was taught. Apache realy doesn't need to know anything about MySQL, it gets that information from PHP4. On the configure line I would go with:

    ./configure --prefix=/usr/local/apache --enable-module=so --with-apxs=/usr/local/apache/bin/apxs

    Good Luck

  14. #14
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YTou can leave the /usr/local/apache/bin/apxs off since you are only telling Apache to compile with APXS it will know where to put it based off the prefix setting.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  15. #15
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, guys. I'll give it a shot.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  16. #16
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP installation glitches

    Installing apache according to the above configuration line, I got the following Error message:

    Configuring for Apache, Version 1.3.20
    + using installation path layout: apache (config.layout)
    configure:Error invalid option '--with apxs'

    I checked all the docs "README.configure," "INSTALL," "./congigure --help" and the apache site. Couldn't find much on apxs. Is it really important that I include it in my configuration line? If so, why doesn't Apache 1.3.20 like it? What will I miss, if I leave it out?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  17. #17
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what I normally use.

    Code:
    ./configure  --with-layout=Apache --prefix=/usr/local/apache  
    --enable-module=speling --enable-shared=speling --enable-module=so 
    --enable-module=headers
    Not sure where I got the --with-apxs option, I think I just was in some PHP mode, its not needed to compile Apache.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  18. #18
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP glitch.

    Thanks,

    I'll give it a shot.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  19. #19
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Installing Apache

    Prepared to build Apache using the above config line. In Developer Shed article on Setting Up Database Driven Websites I read: "you probably shouldn't be root wile doing this," so I did the config step as user.

    Got the following message:

    Configuring for Apache, Version 1.3.20
    src/helpers?PrintPath: pp.t.956: Permission denied
    src/helpers?PrintPath: pp.t.970: Permission denied
    src/helpers?PrintPath: pp.t.980: Permission denied
    ./configure:src/.apaci.pldconf: Permission denied
    ./configure:line 531/: 1467 Broken pipe cat $file
    ./configure:src/.apaci.pldconf:No such file or directory.

    Questions:
    1. Would I have gotten these messages if I had done this step as root?
    2. Are these messages such that I should not proceed to the next step without repairs?
    3. If so, how repair:
    a. Reformat drive and reinstall Redhat 7.1?
    b. Remove the /usr/local/apache file?
    c. Somehow tweak the existing configuration
    d. Do the configuration step again as root?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  20. #20
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    d


    I think its you probably should be root while doing this. Where did you get that line about not being root? I am pretty sure you need to be doing it as root.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  21. #21
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Not as root

    I got the thing about doing ./configure not as root from http://www.devshed.com/Server_Side/A...ase/page4.html

    I'll go ahead and do it again as root anyhow.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  22. #22
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP glitch

    TA DAAAAA! It's working.

    Now all I have to do is figure out how to make Apache 1.3.20 and MySQL 3.23.42 start automatically on bootup. But tomorrow is another day.

    Many thanks to all for the great help.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  23. #23
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically its just copying some scripts from the distro folder to the /etc/rc.d/init.d folder and making omse sym links to them from the /etc/rc.d/rc3.d folder.


    To start MySQL automatically
    http://mysql.he.net/documentation/my...utomatic_start

    grab the mysql.server script from the mysqlroot/share/mysql folder and stick it in the init.d folder. Then make a symlink like the others in rc3.d, thats it



    For apache
    Same principles as before

    http://beavis/docs/invoking.html#boot
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  24. #24
    SitePoint Member
    Join Date
    Sep 2001
    Location
    State College, PA
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, i had the same problem installing on redhat 7. All you have to do is configure php with --zlib. If that don't work go to www.thickbook.com and email Julie.

  25. #25
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uh... --with-zlib sloved your php compilation errors? Thats one I have never heard before. How in the world did that happen? Are you sure it wasn't another issue?
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •