did you add the line...
AddType application/x-httpd-php .php
to your httpd.conf file?
did you add the line...
AddType application/x-httpd-php .php
to your httpd.conf file?
I have moved the php folder into my htdocs folder and reconfigure the path in the config file. Now it wants to open the php files with dreamweaver but still will display html only pages in my browser. In the php config file I am not sure if I need to set this line or if has anything to with the problem:
; The directory under which PHP opens the script using /~username used only
; if nonempty.
user_dir =
And yes this is at the end of my apache config file:
AddType application/x-httpd-php .php
Bknvc1
You dont and shouldn't move the PHP folder into the htdocs directory, what you need to do is put any PHP FILES, that you create in the htdocs dierctory (or any sub-directorys that you place there) then through the browser call the file you have created, remembering to add the .php suffix.
The line in the httpd.conf file that your interested in is around line 228 and is: DocumentRoot "C:/www" where I have www as my base directory you will probably have the default which will be your path to htdocs
I have my php file for testing in the htdocs in a folder labeled examples I was using the following to try and test the page:
http://localhost/examples/php_test.php (using 127.0.0.1 gives me the same results)
I have reconverted the files back but still having problems dreamweaver. I must have missed something but I will figure that out.
As far as my document root settings they are:
doc_root = "C:\Program Files (x86)\Apache Group\Apache2\htdocs"
Does this look right to you?
Bknvc1
Yes that looks right.
Okay then my give up. I guess I will concide to the fact I can not get this to work. I apreciate you taking the time to help.
Bknvc1
If you are using the short style tags (<? .... ?> instead of <?php .... ?>), you have to make sure that the "short_open_tag" directive in php.ini is set to on
Where can I change to have the short directives done???
I found the following statements:
short_open_tag = Off
#Allow ASP-style <% %> tags.
#asp_tags = Off
I'm close to the right lines???
If people don't want the hassle of loading up all the components separatly then i suggest a one click installation program, i wouldn't normally recommend a program like this but this one works perfect with no bugs and causes no hassle.
jborges wrote:Where can I change to have the short directives done???
I found the following statements:
short_open_tag = Off
#Allow ASP-style <% %> tags.
#asp_tags = OffI'm close to the right lines???
Change
short_open_tag = Off
to
short_open_tag = On
Ether that or write your code with
<?php
all your php related stuff in here
and maybehere also then when done
?>
If you can save
<?php echo phpinfo();?>
and get a table full of stuff about PHP with a blue background then your server has PHP on and running now you just need to set it up the way you wish to write code. If you are using short tags then you need to just open with <? and end with ?> if not you need <?php and ?> and that is set in the php.ini, don;t give up just make it work the way you want.
I have PHP5, Apache2, mySQL 5, PostgreSQL, MS SQL all running in Windows XP Pro x64. It does work.
What you need to do is in your httpd.conf file (Located In: C:\Program Files (x86)\Apache Group\Apache\conf) is add this at the bottom:
LoadModule php5_module "C:/PHP/php5apache2.dll"
PHPIniDir: C:\PHP
This will load the PHP module in Apache, and point Apache to the php.ini file which is needed for Apache to initialize PHP properly.
Then, you also need to add "C:\PHP" to your Path variable. You can do that by:
Right-click My Computer
Choose Properties
Select "Advanced" Tab
Click "Environment Variables" buttton (bottom area)
In the bottom group, where it says "System Variables", scroll down and select "Path".
[indent]It should already have a value of something like: "%SystemRoot%\system32;%SystemRoot%;"[/indent]
Go to the end, and add this: ";C:\PHP"
Click "Ok", Click "Ok", Click "Ok"
Restart computer
Start Apache (if not automatically configured to do so)
Try and run a PHP script
If that still doesn't work, may I suggest you uninstall everything, and work through this tutorial:
Installing a new web server: Apache2, PHP5, mySQL, phpMyAdmin