Forum Moderators: coopster

Message Too Old, No Replies

Pulling my hair out trying to install PHP

         

Block19Row13

8:30 am on Jun 16, 2009 (gmt 0)

10+ Year Member



Hi Everyone,

I bought a copy of PHP and MySQL Web Development by Luke Welling and Laura Thompson and am trying to install PHP.

Ive got Apache and MySQL running fine, but ive followed the installation guide to PHP to the letter and have spent hours pulling my hair out.

to let you know what i have done:

i downloaded the win32.zip and extracted to c:/php

i then made a copy of php.ini-dist and renamed it php.ini, in this file i changed the extension_dir line to read:

extension_dir = "C:/php/ext"

i then set the doc_root to read:

doc_root = "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

the book then tells you to set some of the extensions to run, the following had the semi colons removed from the begining of the control:

extension=php_gd2.dll
extension=php_imap.dll
extension=php_mysqli.dll

and the following was added:

extension=php_pdflib.dll

php.ini now saved

it then tells me to edit httpd.conf in the apache conf.

it said to look for the following lines:

LoadModule php5_module C:/php/php5apache2_2.dll
PHPIniDir "C:/php/"
AddType application/x-httpd-php .php

and if you couldnt find them (which i couldnt) to add them, i added them but it didnt say where to.

this file was saved and the apache server was restarted.

i then created test.php containing the <? phpinfo(); ?> line and saved this in htdocs within apache.

i then pull this up on a browser using [localhost...] - the result is a page cannot be found.

some additional info:

when i make any changes to a file in the htdocs folder im aksed to make the changes at administrator level, and when you browse the htodoc folder using windows exlporer you cant see the test.php file.

if anyone can help id be very grateful.

perhaps PM me so you can get a copy of my php.ini and httpd.conf or send me copies that work.

its very frustrating, ive had this great book for 2 days but cant do anything with it!

mvaz

10:25 am on Jun 16, 2009 (gmt 0)

10+ Year Member



I never fancied installing php+mysql by referring a book during the process. I downloaded wamp5 which includes phpmyadmin as well and installed it NOT on the programs directory, but on separate directory (mine is on c:/php). Once installed, all I did was uncommented the dll files for gd library and curl library. It works fine for me and I believe it should for you too.

SteveWh

10:35 am on Jun 16, 2009 (gmt 0)

10+ Year Member



Perhaps these assorted facts from my installation of WAMP will help:

I installed all the components of WAMP while logged into an Administrator account.

However, I use Apache from within a Limited account. But as I recall, Apache itself must be running in an Administrator account. Therefore...

In order to start Apache, I first launch the "Monitor Apache Servers" application, but I launch it using "Run as..." and use my Administrator account password

I then choose "Start Apache" from the menu of the monitoring application.

Because everything was installed as Administrator, there are some other things I must do as Administrator, such as editing httpd.conf. This can be done from the Limited account by launching Notepad using "Run as..." and then navigating to httpd.conf to edit it.

When you first set up Apache, I think it has a default test page saying something like "It works!". Does that show ok?

Block19Row13

12:51 pm on Jun 16, 2009 (gmt 0)

10+ Year Member



yes i got the It Works page.

since then i have uninstalled everything and tried WAMP.

just tried to write my first script and when i prcess the form over to orderprocess.php it just outputs all the text, html and php so something isnt write.

this is so frustrating.

Block19Row13

12:54 pm on Jun 16, 2009 (gmt 0)

10+ Year Member



scrap that, got it working, i wasnt putting files in the correct folder!

henry0

1:09 pm on Jun 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do not use the short tag <?
it will not be supported by php6

coopster

3:38 pm on Jun 16, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Also, you should consider using AddHandler rather than Addtype. Further reading on this topic:

[webmasterworld.com...]
[webmasterworld.com...]