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.
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:
Now, when i try to access the file by writing in browser: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
192.168.0.102/test.php
a blank page is displayed.I have tried two scripts :
andCode:<?php phpinfo(); ?>
but everytime i restart the httpd, and try to access the page.The page displayed is blank.Can anyone help me with this problem?Code:<?php echo"Hello world"; ?>
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.
Hello!
I have tried different solutions from net.But any of them didn't worked.Can anyone suggest me something?
Try this as index.php .Originally Posted by honey bee
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.Code:<html> <?php echo"Hello world"; ?> </html>
HTH ..
Oh yeah, you need to do the same thing for phpinfo() function call. I just tested it and it worked.
Hello!
Thanks a lot for your reply, but it isn't working also.![]()
Where is your php installed? Check like this
Mine return as /usr/bin/phpCode:whereis php
Then I do
which returnCode:/usr/bin/php -v
If you want to see if it's working on my site, check here.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:~$
The code is
HTH ..Code:<html> <head> <title> System Information - Sienna64 </title> </head> <?php phpinfo(); ?> </html> ~ "index.php" [readonly] 6L, 97C
Also, what's your apache version?
Mine returnCode:apache2 -v
Make sure you have the php modules loaded.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$
Code:compunuts@sienna64:/etc/apache2/mods-enabled$ ls php5.conf php5.load compunuts@sienna64:/etc/apache2/mods-enabled$
Bookmarks