Hi i am newbie.
I want to configure Apache, PHP, MYSQL and Drupal Individually on a localhost.
I installed apache first and it is working. And then when i try to install php 5.x version, i configured both php.ini and httpd.conf files.
To test my php installation i created test.php file with the following code
echo "testing for php";
in htdocs folder.
Opened browser, when i go to http://localhost/ it displays "It works !"
then i go to http://localhost/test.php then it displays..
echo "testing for php";
the full code in the test.php file instead of the message "testing for php"
How can i overcome this problem ? I am engaging with this problem from four days. So Please help me.
I know there is a small mistake in configuring both php.ini and httpd.conf files properly. But I was not able to find out.
Thanks
Comments
Perhaps a stupid suggestion,
Perhaps a stupid suggestion, but the thing that comes mind is that perhaps you have not activated the php module in the Apache "httpd.conf". At least that it is how it is on the mac. In the default installation php is not activated and you have to uncomment a line that says something like "load module php".
At any rate, it seems your localhost server does not know that files with the .php suffix should be interpreted as php. That is why you can read the entire code.
---
a little more info
I have just completed a load of Apache 2.2 , followed by an install of PHP 5.2.9. The LoadModule statement should have been put in the config file by the PHP install. Look at the end of httpd.conf in the Apache Conf directory and you should see it. According to the config directions in the Drupal install handbook, you also change the DocumentRoot statement and the Directory statement, and add "index.php" to the DirectoryIndex statement.
I'm just learning myself and this config is giving me a headache too; can't find anywhere which gives the syntax for adding the index.php statement. Hope this helped though.
DirectoryIndex is easy
Just change: DirectoryIndex index.html to: DirectoryIndex index.html index.php
Those efforts are done !!!
Hi guys....
Thanks for your response. DirectoryIndex was setup like this ....
DirectoryIndex index.html index.html.var index.php
loadmodule was also setup properly. Here I have a doubt.
I am using php5.2.3 version. So which module should be added to loadmodule line ?
php5apache2.dll or php2apache2_2.dll
One more thing I have to tell is that, I copied drupal6.12 to htdocs in apache installation folder. And renamed it to drupal6.
Then I open browser and went to this address http://localhost/drupal6 and i am seeing all the list of things(.txt, .php and folders) in drupal6 folder in a tree structure. If I click .txt files they are opening in the same window, and if i press a folder link i am redirected to further links in that folder. So that is how it is behaving !!!
I hope any experienced guy can solve this problem in min's. I am also learning individually here with the help of WEB. If any guy confident and can assure to a perfectly working system with a fresh Installation in my localhost system, can guide me and i would like to follow his words.
Thanks....
It appears that PHP may not
It appears that PHP may not be loaded. If you're using Apache 2.2.x then you want to load php5apache2_2.dll.
Create a file named phpinfo.php containing the following code:
Place it in your document root and go to http://localhost/phpinfo.php. If PHP is loaded you'll see a screenful of information about Apache and PHP.
Guys Gone through It !!!!!!
Hi Guys I am much happy to your support. After the encounter with above silly small tricky problem, I removed every thing from my system(localhost) but kept MySql as it is. And today I installed each one individually (Apache, php).
But again same problem (Displaying the whole code in test.php) !!! I just checked the php folder Property Attributes It is set to Read Only. I disabled it. Then it works and displays "Hello World" message and i am happy.
But The new Problem is at the "Set up Database" step. It displays the following message:
-------------------------
Database configuration:
The following installation warning should be carefully reviewed:
Operations on Unicode strings are emulated on a best-effort basis. Install the PHP mbstring extension for improved Unicode support. (Currently using Unicode library Standard PHP)
Your web server does not appear to support any common database types. Check with your hosting provider to see if they offer any databases that Drupal supports.
-------------------------
What settings I have to change, enable or disable. I think this is also small tricky problem.