Avatar billede mckim Nybegynder
23. august 2001 - 16:39 Der er 7 kommentarer og
1 løsning

Problem med PHP4

Nu har jeg installeret PHP4 4 gange, men hver gan jeg taster 127.0.0.1/minfil.php, så viser den kun html-koden. Hvad er der galt?. Jeg bruger Apache.

Avatar billede limemedia Nybegynder
23. august 2001 - 16:41 #1
har du husket at tilføje de tre linier til din httpd.conf ?
ScriptAlias /php/ \"c:/php/\"
AddType application/x-httpd-php .php .phtml
Action application/x-httpd-php \"/php/php.exe\"



Taget fra php.net
Details of installing PHP on Windows with Apache 1.3.x
There are two ways to set up PHP to work with Apache 1.3.x on Windows. One is to use the CGI binary (php.exe), the other is to use the Apache module dll. In either case you need to stop the Apache server, and edit your srm.conf or httpd.conf to configure Apache to work with PHP.

Although there can be a few variations of configuring PHP under Apache, these are simple enough to be used by the newcomer. Please consult the Apache Docs for further configuration directives.

If you unziped the PHP package to C:\\PHP\\ as desribed in the General Installation Steps section, you need to insert these lines to your Apache conf file to set up the CGI binary:


ScriptAlias /php/ \"c:/php/\"

AddType application/x-httpd-php .php .phtml

Action application/x-httpd-php \"/php/php.exe\"

Remerber to restart the server, for example, NET STOP APACHE followed by NET START APACHE.

If you would like to use PHP as a module in Apache, you should move php4ts.dll to the windows/system (for Windows 9x/Me) or winnt/system32 (for Windows NT/2000) directory, overwriting any older file. Then you should add the following two lines to you Apache conf file:


LoadModule php4_module c:/php/sapi/php4apache.dll

AddType application/x-httpd-php .php .phtml


To use the source code highlighting feature, simply create a PHP script file and stick this code in: <?php show_source (\"original_php_script.php\"); ?>. Substitute original_php_script.php with the name of the file you wish to show the source of. (This is the only way of doing so).

Note: On Win-Apache all backslashes in a path statement such as: \"c:\\directory\\file.ext\", must be converted to forward slashes.



/ Lars
Avatar billede mckim Nybegynder
23. august 2001 - 16:48 #2
ljweb>> Den linje er tilføjet.
Avatar billede mckim Nybegynder
23. august 2001 - 16:50 #3
Det virker ved ren html, men når der er PHP i. Så viser den kun, html-koden. Altså den tolker PHP-koden rigtigt, men viser kun HTML koden.
Avatar billede limemedia Nybegynder
23. august 2001 - 16:50 #4
og du har genstartet ? du har kopieret php.ini til dit windows bibliotek ?
Avatar billede limemedia Nybegynder
23. august 2001 - 16:55 #5
hvis den tolker php\'en, hvad er så problemet ?
Avatar billede mckim Nybegynder
23. august 2001 - 16:58 #6
Den viser kun HTML-koden :-(
Avatar billede otis Nybegynder
24. august 2001 - 22:27 #7
har du husket at loade php modulet ?.. under Linux er dette ikke default
Avatar billede mckim Nybegynder
03. januar 2002 - 19:34 #8
Tror lige jeg lukker :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester