Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: LAMP

  1. #1
    AuzzieDev NNTP User

    Default LAMP

    Hello all, new to the forums but not overly new to openSUSE... Been following the LAMP how to guide located here: Linux Apache MySQL PHP Server (lamp - openSUSE) and i have followed it to the letter yet i am unable to use PHP files, whenever i try to use a php file it offers me the chance to download rather then apache try to load it. I was wondering if anyone had any insight or help that they could offer thank you in advance

  2. #2
    Join Date
    Jun 2008
    Location
    /dev/belgium
    Posts
    1,946

    Default Re: LAMP

    install apache php package

  3. #3
    AuzzieDev NNTP User

    Default Re: LAMP

    already have done

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: LAMP

    Enable the php5 module. Either:

    a2enmod php5

    or edit /etc/sysconfig/apache2 and add php5 to the list in APACHE_MODULES (the live line, not the comment line)

    Then restart apache2

    /etc/init.d/apache2 restart

  5. #5
    Join Date
    Jun 2008
    Location
    /dev/belgium
    Posts
    1,946

    Default Re: LAMP

    are you placing your files in $HOME/public_html? if so, you need to enable php support in the /etc/apache2/mod_userdir.conf file. Add the below line *inside* the <Directory /home/*/public_html> stuff

    Include /etc/apache2/conf.d/php5.conf

    EDIT: and of course, whenever you change something to the apache configs, restart the server

  6. #6
    AuzzieDev NNTP User

    Default Re: LAMP

    unfortunatly i have tried the suggestions from both of you and neither seems to work

  7. #7
    Join Date
    Jun 2008
    Location
    /dev/belgium
    Posts
    1,946

    Default Re: LAMP

    well, then you did something wrong. Works here with no problems at all. Also, do your php scripts begin with <? only? If so, you need to change them to <?php instead

    Also, post your mod_userdir.conf file

  8. #8
    AuzzieDev NNTP User

    Default Re: LAMP

    all my scripts start with the full (<?php) tag.

    #
    # UserDir: The name of the directory that is appended onto a user's home
    # directory if a ~user request is received.
    #

    <IfModule mod_userdir.c>
    # Note that the name of the user directory ("public_html") cannot easily be
    # changed here, since it is a compile time setting. The apache package
    # would have to be rebuilt. You could work around by deleting
    # /usr/sbin/suexec, but then all scripts from the directories would be
    # executed with the UID of the webserver.
    #
    # To rebuild apache with another setting you need to change the
    # %userdir define in the spec file.

    # not every user's directory should be visible:
    UserDir disabled root

    # to enable UserDir only for a certain set of users, use this instead:
    #UserDir disabled
    #UserDir enabled user1 user2


    # the UserDir directive is actually used inside the virtual hosts, to
    # have more control
    #UserDir public_html

    <Directory /home/*/public_html>

    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

    <Limit GET POST OPTIONS PROPFIND>
    Order allow,deny
    Allow from all
    </Limit>

    <LimitExcept GET POST OPTIONS PROPFIND>
    Order deny,allow
    Deny from all
    </LimitExcept>
    Include /etc/apache2/conf.d/php5.conf
    </Directory>

    </IfModule>

  9. #9
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: LAMP

    Do

    /usr/sbin/httpd2 -M

    and see if php5 is on the list. If it isn't you haven't really enabled it.

  10. #10
    Join Date
    Jun 2008
    Location
    /dev/belgium
    Posts
    1,946

    Default Re: LAMP

    You've placed the Include stuff in the wrong line That's the correct way

    Code:
    <Directory /home/*/public_html>
    
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Include /etc/apache2/conf.d/php5.conf
    
    <Limit GET POST OPTIONS PROPFIND>
    Order allow,deny
    Allow from all
    </Limit>
    
    <LimitExcept GET POST OPTIONS PROPFIND>
    Order deny,allow
    Deny from all
    </LimitExcept>
    </Directory>

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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