Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all. I've been following the article "Setting Up a Server" Contributed by Davidlohr Bueso to this forum. I am totally new to Linux and trying to educate myself in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2006
    Posts
    9

    PHP Problem


    Hi all.

    I've been following the article "Setting Up a Server" Contributed by Davidlohr Bueso to this forum. I am totally new to Linux and trying to educate myself in its wonders. I am Using Debian and have successfully installed Apache2/2.0.54 and my simple website is up and running. I followed the instructions Installing and Configuring MySQL - no error messages there either!

    However, when completing the procedures for "installing and Configuring PHP", all appeared to go well (I installed PHP4). However, when it came to running the recommended test document in my browser (/var/www/test.php which contains the single line):

    <? phpinfo(); ?>

    the following was returned:

    "Warning: Unknown(/var/www/test.php): failed to open stream: Permission denied in Unknown on line 0

    Warning: (null)(): Failed opening '/var/www/test.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0"


    Looking in the Apache2 error log, there is a whole page of messages refering to this action, The first two lines are:

    PHP Warning: Function registration failed - duplicate name - mysql_connect in Unknown on line 0
    PHP Warning: Function registration failed - duplicate name - mysql_pconnect in Unknown on line 0


    ... and so on

    I have tried to understand the problem but all that I have read so far has not provided me with any clue.

    Can anyone help?

    Thanks

    Tom

  2. #2
    Just Joined!
    Join Date
    Sep 2006
    Posts
    5
    well I'm not sure if this applies to your PHP version but I know 5 has this feature where you have to put <?php for the script to work correctly. This can be modified on the php.ini file though but I would recomend just using <?php all the time for security. Also it is complaining about permissions...are you sure your web server has access to that file? Can you write a basic html file and see it.

    example

    <head>HELLO WORLD</head> save at index.htm and see if you can see it in the browser.

    If you can you have the web server working fine but issues with PHP. Make sure you add support for your version of php in your apache httd.conf file as well. tries this out if no luck will post more.

  3. #3
    Just Joined!
    Join Date
    Aug 2006
    Posts
    9
    Hi and thanks for the advice.

    Apahe2 is running ok as an HTML webserver. I have a simple website hosted on it and it is accessible from local (LAN) machines and the Internet.

    I tried <?php in my test.php file, but to no avail.

    As far as support for my version (4) of php in my apache2 httd.conf file, that file only contains the text:

    # This is here for backwards compatability reasons and to support
    # installing 3rd party modules directly via apxs2, rather than
    # through the /etc/apache2/mods-{available,enabled} mechanism.
    #
    #LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so

    I have a file in my mod's-enabled folder (php4.load) which contains:

    LoadModule php4_module /usr/lib/apache2/modules/libphp4.so

    The path is correctly directed at the locationof libphp4.so


    So it would seem that there is a php issue. Any suggestions as to testing whether PHP is enabled other than the orifinal test file would be appreciated

Posting Permissions

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