marek Posted June 4, 2006 Share Posted June 4, 2006 Hello,I'm totally new on this forum and totally fresh at PHP. I have some installation problems with PHP. I've installed Apache 1.3 and then PHP 5. Everything step by step with php manual.The server is working properly but when I created test php file with <? phpinfo() ?> instruction it displays <? phpinfo() ?> except for php inf site.Where is the problem?Thanks for your help.Marek Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/ Share on other sites More sharing options...
trq Posted June 5, 2006 Share Posted June 5, 2006 Try...[code]<?php phpinfo() ?>[/code]You should avoid trying to use short tags. Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-41905 Share on other sites More sharing options...
marek Posted June 5, 2006 Author Share Posted June 5, 2006 [!--quoteo(post=380080:date=Jun 5 2006, 02:20 AM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 5 2006, 02:20 AM) [snapback]380080[/snapback][/div][div class=\'quotemain\'][!--quotec--]Try...[code]<?php phpinfo() ?>[/code]You should avoid trying to use short tags.[/quote]Nothing has changed. Now it just dispalys <?php phpinfo() ?> instead of <? phpinfo() ?>.So I still think it's installation problem (that Apache server "doesn't see" the code of PHP).By the way, I did the instalation with PHP manual.Thanks for helpMarek Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42046 Share on other sites More sharing options...
mmcdonnell Posted June 5, 2006 Share Posted June 5, 2006 Did you remember to install the module plugins for PHP in Apache? (it's not really *installing* just adding them to the .conf file.) Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42047 Share on other sites More sharing options...
marek Posted June 5, 2006 Author Share Posted June 5, 2006 Yes.I have added four lines to httpd file:LoadModule php5_module "C:/PHP/php5apache.dll"AddModule mod_php5.cAddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phpsBy the way, is the place of these lines in this httpd file important?Marek Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42048 Share on other sites More sharing options...
wildteen88 Posted June 5, 2006 Share Posted June 5, 2006 Okay run through these points:[list][*]Check that php.ini is in either in C:\WINDOWS or C:\WINDOWS\SYSTEM32[*]Check that php5td.dll is also either in the C:\WINDOWS or the C:\WINDOWS\SYSTEM32 folder[*][!--sizeo:3--][span style=\"font-size:12pt;line-height:100%\"][!--/sizeo--]ONLY DO THE ABOVE TWO STEPS IF YOU HAVE NOT ADDED THE LOCATION OF THE PHP FOLDER TO THE WINDOWS PATH VARIABLE[!--sizec--][/span][!--/sizec--][*]Check that any configurations settings within the php.ini are correct[*]Change the [i]display_startup_errors[/i] (located near line 372 in the php.ini file) directive from Off to On, so it is read as the following:[code]display_startup_errors = On[/code]Now restart Apache, If there are any errors with the PHP configuration you should get an error message telling you whats wrong when Apache attempts to restart/load[*]Check Apache's error log for any startup errors. Apache's error log is located in the logs folder within the Apache installation folder.[*]Make sure that your restart Apache when you make any changes to the php.ini/httpd.conf file and when you move any files that is stored either in the PHP folder or the Apache folder.[/list] Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42051 Share on other sites More sharing options...
marek Posted June 5, 2006 Author Share Posted June 5, 2006 1. I already have c:\PHP in my windows path variable2. I have php.ini on c:\windows3. I have php5ts.dll on c:\php4. I have aded two lines in php.ini:doc_root = c:\Program Files\Apache Group\Apache\htdocsextension_dir = c:/PHP/extand I have changed display_startup_errors from Off to On.5. I have restarted Apache6. Error in Apache logs is: File does not exist: c:/program files/apache group/apache/htdocs/favicon.ico7. Web localhost works properly.Still doesn't work.So if I have c:\php in windows path variable, I should delete php.ini from c:\windows and php5ts.dll form c:\php?Marek Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42064 Share on other sites More sharing options...
wildteen88 Posted June 5, 2006 Share Posted June 5, 2006 If you have the php folder in the windows path variable than move php.ini back to C:\php and add the following line of code to the httpd.conf file:[code]PHPIniDir "C:/php"[/code]Now save the httpd.conf file and restart Apache.Also I notice you added this line in the httpd.conf:[code]AddModule mod_php5.c[/code]this is not actually needed.Alsol when you added the PHP to window path variable make sure it is correct and when you created the variable that you restarted windows in order for the new path variable to become available. Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42067 Share on other sites More sharing options...
marek Posted June 5, 2006 Author Share Posted June 5, 2006 1. After I added: PHPIniDir "C:/php" to httpd.conf file, I got the message it's invalid command.So I deleted it.2. I moved php.ini to c:/php3. My windows path variable looks like this:%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\PHP3. I also used command line and in windows directory run php -i. It worked properly.4. Web localhost works properly.But Apache and PHP still dont't want to work together.Marek Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42089 Share on other sites More sharing options...
wildteen88 Posted June 5, 2006 Share Posted June 5, 2006 How are you saving your php files? are you saving them with a .php extension?As far as I can see there is nothing wrong with how Apache and PHP are configured. Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42146 Share on other sites More sharing options...
marek Posted June 5, 2006 Author Share Posted June 5, 2006 I save them with .php extension. The name is test.php. And it includes only one line: <? php phpinfo() ?>.I really don't know what to do now.Thanks anyway.Marek Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42182 Share on other sites More sharing options...
marek Posted June 7, 2006 Author Share Posted June 7, 2006 It's me again. I still have the same problem. Nothing has changed. When I run php -i in windows directory, it works properly.I can see page localhost on Apache.But still browser can't see the php code.So in my opinion the problem is only about settings in httpd.conf file.Am I right?Marek Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42750 Share on other sites More sharing options...
marek Posted June 16, 2006 Author Share Posted June 16, 2006 I gave up with. I've tried so many times make this work... But still the same problem.So I've changed Apache 1.3 for Apache 2.0.In php manual it's said that I have to add:LoadModule php5_module "c:/php/php5apache2.dll"AddType application/x-httpd-php .phpPHPIniDir "C:/php"Is this really all?Is the place of these lines in httpd.conf file important?Thanksmarek Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-46260 Share on other sites More sharing options...
wildteen88 Posted June 16, 2006 Share Posted June 16, 2006 Yes at minmun three lines of configuration code is whats needed to tie Apache and PHP together!Where you place these lines doesn't matter but I preferr to put them in thier proper place:[code]LoadModule php5_module "c:/php/php5apache2.dll"PHPIniDir "C:/php"[/code]At the end of the LoadModule list which is after this line:[code]#LoadModule ssl_module modules/mod_ssl.so[/code]I add this line:[code]AddType application/x-httpd-php .php[/code]after:[code]AddType application/x-gzip .gz .tgz[/code]and thats it! However you can place anywhere if you wish but I prefer not to. Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-46305 Share on other sites More sharing options...
marek Posted June 16, 2006 Author Share Posted June 16, 2006 It's working!I made two things together that helped.Firstly I moved php.ini to C:/WINDOWS and changed line in httpd.conf file from PHPIniDir "C:/php" to PHPIniDir "C:/WINDOWS".Secondly I added .txt at the end of the line: AddType application/x-httpd-php .php .phtml. I did this because I noticed that my file test.php on web localhost is shown as test.php.txt (actually, I don't know why).I restared server and I could see beautiful phpinfo side.Thanks to everyone that helped me on this forum (asspecially wildteen88).Now I can start to learn php (I think I'll have more problems since now). Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-46323 Share on other sites More sharing options...
wildteen88 Posted June 16, 2006 Share Posted June 16, 2006 About the .txt thing are you saving your files in notepad/wordad?if you are, make sure when you go to save your files with the .php extension within notepad the [b]save as type[/b] select box has [b]All Files[/b] selected.Notepad will save any file with the txt file extension by defualt. Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-46328 Share on other sites More sharing options...
marek Posted June 16, 2006 Author Share Posted June 16, 2006 Notepad. You were right. Quote Link to comment https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-46338 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.