Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
PHP + Apache web server
Results 1 to 9 of 9

Thread: PHP + Apache web server

  1. #1
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146

    Question PHP + Apache web server

    hello!

    I have created a "test.php" file in "/var/www/html " and in /etc/httpd/conf.d
    i have the file php.conf containing:

    Code:
    #
    # PHP is an HTML-embedded scripting language which attempts to make it
    # easy for developers to write dynamically generated webpages.
    #
    
    LoadModule php4_module modules/libphp4.so
    
    #
    # Cause the PHP interpreter to handle files with a .php extension.
    #
    AddType application/x-httpd-php .php
    
    #
    # Add index.php to the list of files that will be served as directory
    # indexes.
    #
    DirectoryIndex index.php
    Now, when i try to access the file by writing in browser:

    192.168.0.102/test.php

    a blank page is displayed.I have tried two scripts :

    Code:
    <?php phpinfo(); ?>
    and

    Code:
    <?php echo"Hello world"; ?>
    but everytime i restart the httpd, and try to access the page.The page displayed is blank.Can anyone help me with this problem?

  2. #2
    take a look at the source of the page. If there is <?php phpinfo(); ?> then the page is being displayed but, not rendered by PHP. take a look at the httpd logs. those usually tell you something.

  3. #3
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146

    Question Can't figure it out!

    Hello!

    I have tried different solutions from net.But any of them didn't worked.Can anyone suggest me something?

  4. #4
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935
    Quote Originally Posted by honey bee
    Now, when i try to access the file by writing in browser:

    192.168.0.102/test.php

    a blank page is displayed.I have tried two scripts :

    Code:
    <?php phpinfo(); ?>
    and

    Code:
    <?php echo"Hello world"; ?>
    but everytime i restart the httpd, and try to access the page.The page displayed is blank.Can anyone help me with this problem?
    Try this as index.php .
    Code:
    <html>
    <?php echo"Hello world"; ?>
    </html>
    You need to put php codes in html tags since php is just scripting and not displaying codes. You need to tell your browser to how to display it. The php part was just so that your server knows it needs to script it.

    HTH ..

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    - The truely community run Linux/Floss forum !

    No IT BS !!

  5. #5
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935
    Oh yeah, you need to do the same thing for phpinfo() function call. I just tested it and it worked.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    - The truely community run Linux/Floss forum !

    No IT BS !!

  6. #6
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146

    Thanks a loT!

    Hello!

    Thanks a lot for your reply, but it isn't working also.

  7. #7
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935
    Where is your php installed? Check like this

    Code:
    whereis php
    Mine return as /usr/bin/php

    Then I do

    Code:
    /usr/bin/php -v
    which return

    compunuts@sienna64:~$ /usr/bin/php -v
    PHP 5.0.5-2ubuntu1.2 (cli) (built: Mar 8 2006 08:18:28)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v2.0.5, Copyright (c) 1998-2004 Zend Technologies
    compunuts@sienna64:~$
    If you want to see if it's working on my site, check here.

    The code is

    Code:
    <html>
    <head>
    <title> System Information - Sienna64 </title>
    </head>
    <?php phpinfo(); ?>
    </html>
    ~
    "index.php" [readonly] 6L, 97C
    HTH ..

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    - The truely community run Linux/Floss forum !

    No IT BS !!

  8. #8
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935
    Also, what's your apache version?

    Code:
    apache2 -v
    Mine return

    Code:
    compunuts@sienna64:/etc/apache2/mods-enabled$ apache2 -v
    Server version: Apache/2.0.54
    Server built:   Jan  7 2006 13:51:23
    compunuts@sienna64:/etc/apache2/mods-enabled$
    Make sure you have the php modules loaded.

    Code:
    compunuts@sienna64:/etc/apache2/mods-enabled$ ls
    php5.conf  php5.load
    compunuts@sienna64:/etc/apache2/mods-enabled$

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    - The truely community run Linux/Floss forum !

    No IT BS !!

  9. #9
    Member honey bee's Avatar
    Join Date
    Feb 2006
    Location
    Pakistan
    Posts
    146

    Smile

    Hello!

    Sorry for replying late.My system crashed and i did re-installation.Now, php is working fine.Thanks a lot for your concern.

Similar Threads

  1. apache server problem
    By pankajkarde in forum Redhat / Fedora
    Replies: 2
    Last Post: 01-17-2007, 10:16 AM
  2. Apache Web Server Troubles
    By [a2]ACE in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 02-04-2006, 08:37 AM
  3. apache server with SSL connection
    By erictcy in forum Linux - General Topics
    Replies: 0
    Last Post: 10-21-2004, 02:15 AM
  4. apache server
    By M_A_G_I_C in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 12-05-2002, 12:38 AM
  5. apache server side includes
    By philosophia in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 05-15-2002, 06:46 AM

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
  •