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

Thread: How do I start PHP?

  1. #1

    Default How do I start PHP?

    I am installing opensuse 11.3 as a text-based web server.

    I have installed apache2, php, php-gd, php-pear and mysql...

    Now, I am trying to run the installwizard.php to install this LAMP app and any php file, seems to just download, instead of 'resolve to the screen' in the browser.

    • When I run chkconfig, and see that apache and mysql are running.
    • I have already restarted apache, and it seems to come up okay.
    • I have created a test index.html file, and seems to be loading fine.
    • I have googled for this, and it doesn't seem to happen to anyone else!
    • when I try to yum install php, it says that version php5-5.3.2-1.31.i586 is already installed.


    I am using yum, on the command line.
    Permissions are:
    -rwxr-xr-x 1 root root 5654 2008-08-04 16:39 installtest.php
    -rwxr-xr-x 1 root root 48605 2008-08-04 16:39 installwizard.php
    Any suggestions would be welcome!!!

    - zoomiest
    Last edited by zoomiest; 04-Feb-2011 at 13:31. Reason: added permissions info

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,669
    Blog Entries
    15

    Default Re: How do I start PHP?

    Hi
    What about creating a test phpinfo file? You can also use apache2ctl -M to see the loaded modules

    Also once you have installed whatever applications your using, MAKE sure you either move or rename any of those setup files otherwise you will be owed before you know it if your system is internet facing. Install something like awstats to keep an eye out or review the logs for 404 entries.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Dec 2010
    Location
    Ankara, Turkey
    Posts
    250

    Default Re: How do I start PHP?

    Try using:

    Code:
    php -r 'phpinfo();'
    on the command line. See if you get any errors. If this goes fine, check if apache working as expected; try issuing;

    Code:
    exec 3<> /dev/tcp/localhost/80
    echo -e "GET\n">&3
    cat <&3
    check if you getting anything. If not, probably your apache is not working as expected.

    If this both is fine, it is probably your apache doesn't know how to open php files with. You need to make required settings. Check if you got this file;

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

    This is how mine looks like:

    Code:
    <IfModule mod_php5.c>
            AddHandler application/x-httpd-php .php4
            AddHandler application/x-httpd-php .php5
            AddHandler application/x-httpd-php .php
            AddHandler application/x-httpd-php-source .php4s
            AddHandler application/x-httpd-php-source .php5s
            AddHandler application/x-httpd-php-source .phps
            DirectoryIndex index.php4
            DirectoryIndex index.php5
            DirectoryIndex index.php
    </IfModule>
    And also, you need to have this line

    Code:
    LoadModule php5_module /usr/lib/apache2/mod_php5.so
    in the, /etc/apache2/sysconfig.d/loadmodule.conf

  4. #4
    Join Date
    Mar 2009
    Location
    sri mayapur, west bengal, india
    Posts
    958

    Default Re: How do I start PHP?

    On Sat, 05 Feb 2011 02:06:02 +0530, zoomiest
    <zoomiest@no-mx.forums.opensuse.org> wrote:

    > I have installed apache2, php, php-gd, php-pear and mysql...


    do you have apache2-mod_php5 installed? that's required. then it needs to
    be configured to be used, in /etc/sysconfig/apache2 -- unless that's done
    during installation, which it wasn't when i installed apache & co, after
    every new install.

    --
    phani.

  5. #5
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: How do I start PHP?

    On 02/04/2011 09:36 PM, zoomiest wrote:
    > I am using yum, on the command line.


    you installed yum on openSUSE??

    cool, i didn't know that was possible..

    by the way, you said you have a "text-based web server" what does that
    mean? to me it means you do everything at the command line and there
    is no X server installed...so, when you write "'resolve to the screen'
    in the browser" are you using lynx, links or what?

    or, are you looking in a browser on another machine, networked to the
    server..

    sorry if that is a stupid question.


    --
    DenverD
    CAVEAT: http://is.gd/bpoMD
    [NNTP posted w/openSUSE 11.3, KDE4.5.5, Thunderbird3.0.11, nVidia
    173.14.28 3D, Athlon 64 3000+]
    "It is far easier to read, understand and follow the instructions than
    to undo the problems caused by not." DD 23 Jan 11

  6. #6
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,703

    Default Re: How do I start PHP?

    Why oh why are you running Yum on OpenSuse??

  7. #7

    Default Re: How do I start PHP?

    Thank you Malcolm.
    apache2ctl -M was helpful. php was not loading... will continue my sleuthing.
    BTW, I installed webalizer at your suggestion (awstats wasn't in the repository... is awstats better?)

  8. #8

    Default Re: How do I start PHP?

    Thank you phani.
    apache2-mod_php5 was NOT installed, so I installed it.

    in the /sysconfig/apache2 file, I saw that php5 was included in the apache modules... is this good then?

    APACHE_MODULES="actions alias auth_basic authn_file authz_host authz_groupfile authz_default authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl userdir php5"

  9. #9

    Default Re: How do I start PHP?

    DenverD, ...never a stupid question.
    Yes, there is no X server - just command line.
    Yes, I always install lynx.

    This is just a webserver, working out of my basement, hosting an app that I need for work, and being that I am a fanatic for this Linux stuff, I always wanted to do everything command line (allows me to work from anywhere...)

  10. #10

    Default Re: How do I start PHP?

    When I ran that 3-line code, I got the parsing of my index.html file that I was using to test if apache was working. So, that must be fine.

    When I looked at my /etc/apache2/conf.d/php5.conf I got

    cats:/etc/apache2/conf.d # cat php5.conf
    <IfModule mod_php5.c>
    AddHandler application/x-httpd-php .php4
    AddHandler application/x-httpd-php .php5
    AddHandler application/x-httpd-php .php
    AddHandler application/x-httpd-php-source .php4s
    AddHandler application/x-httpd-php-source .php5s
    AddHandler application/x-httpd-php-source .phps
    DirectoryIndex index.php4
    DirectoryIndex index.php5
    DirectoryIndex index.php
    </IfModule>
    Also, I do have the LoadModule... mod_php5.so in my loadmodule.conf file. Its at the bottom. So, must have been included when I installed apache2-mod_php5...

    Thanks all. let me restart a few things, and get these additions active...

Page 1 of 2 12 LastLast

Posting Permissions

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