Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/
Share on other sites

[!--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 help
Marek
Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42046
Share on other sites

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]
Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42051
Share on other sites

1. I already have c:\PHP in my windows path variable
2. I have php.ini on c:\windows
3. I have php5ts.dll on c:\php
4. I have aded two lines in php.ini:

doc_root = c:\Program Files\Apache Group\Apache\htdocs
extension_dir = c:/PHP/ext

and I have changed display_startup_errors from Off to On.

5. I have restarted Apache
6. Error in Apache logs is:
File does not exist: c:/program files/apache group/apache/htdocs/favicon.ico
7. 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
Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42064
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42067
Share on other sites

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:/php

3. 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:\PHP

3. 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
Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42089
Share on other sites

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
Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-42750
Share on other sites

  • 2 weeks later...
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 .php
PHPIniDir "C:/php"

Is this really all?
Is the place of these lines in httpd.conf file important?

Thanks
marek
Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-46260
Share on other sites

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.
Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-46305
Share on other sites

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).


Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-46323
Share on other sites

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.
Link to comment
https://forums.phpfreaks.com/topic/11183-installation-problems/#findComment-46328
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.