Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP n00bie - inclusion error 2

Status
Not open for further replies.

JustKIDn

MIS
May 6, 2002
386
US
Hi all,

For starters: I've seen this error (see below) in many posts, in many PHP forums (I've done a lot of searching) but I haven't seen the answer yet. I have seen some suggestions. But the reason for getting this error seems to be different for everyone. I haven't seen this error posted for this reason yet. Can someone help me? I've never done any PHP yet.

I just installed PHP 4.3.1 on Caldera OpenLinux. It already had Apache 1.3.11, so I didn't change that.

I thought it would be a good idea to test it before I do anything with it so I found a 'Hello World' script. I copy/pasted it into a file I named hello-world.php and put in /home/httpd/html

This is the file;
Code:
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo &quot;<p>Hello World</p>&quot;; ?>
 </body>
</html>

This is the error I get;

Warning: Unknown(/home/httpd/html/hello-world.php): failed to create stream: Permission denied in Unknown on line 0

Warning: Unknown(): Failed opening '/home/httpd/html/hello-world.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0

Do I need to do something to Apache? I have rebooted to make sure all changes take place.

Is there a daemon that needs to be started for PHP?

Judging by the paths in the errors, I'm not sure if there's anything else to change in the php.ini file which is located in /usr/local/lib - is that right?

The error says 'Permission denied'. Do I need to change permissions somewhere?

tgus

____________________________
Families can be together forever...
 
Hi sleipnir,

I looked and looked for a rpm. But I still haven't figured out how to find that stuff.

I installed from php-4.3.1.tar.gz and I folowed the instructions from here;


Except I skipped the Apache part 'cause I wasn't installing a newer version. Was that a bad thing?

I also never could find a ./configure file for Apache. Any ideas? Do I need to worry about that?

Do I need to reboot every time I make a change to php.ini?

Do I need to start a daemon for php?

Thanks again!

tgus

____________________________
Families can be together forever...
 
You're unusual...most people start with the rpms and work their way up to compiling from source.

You should have done the Apache part of the install. The &quot;make install&quot; part of the PHP compilation process can modify httpd.conf so that Apache will use the PHP module you've just compiled.



Want the best answers? Ask the best questions: TANSTAAFL!
 
Like I said, I haven't had any luck when trying to find rpm's. But compiling from source isn't so hard it seems.

I should have done the Apache part. Why? I didn't want to upgrade Apache. I understand there are problems with Apache 2x and PHP 4x so I wanted to avoid that.

I did do the make, and then make install with PHP and yes it did modify the httpd.conf file. However I did have to add;
AddType application/x-httpd-php .php myself.

BTW: does it matter where the source files are when you install them? I installed from /tmp/tmp

Is there a daemon I need to start for PHP?

tgus

____________________________
Families can be together forever...
 
There is no daemon for PHP.

You said you did not find a &quot;./configure&quot; script for Apache. I still don't understand what that means. Unless you installed Apache from source, there won't be a configure file.

It does not matter where your source files reside, so long as you're sure you don't need them any more. Some machines have garbage collection scripts that run, automatically deleting from /tmp everything over a certain time old.

Are you running Apache as a CGI or as a module?

Want the best answers? Ask the best questions: TANSTAAFL!
 
I thought the ./configure might be important because it was in some instructions.

I'm not sure how Apache was installed. As I mentioned another time, It was all installed at the time I installed the distro.
But if I run httpd -l I get;

Compiled-in modules:
http_core.c
mod_so.c
suexec: disabled; invalid wrapper /usr/sbin/suexec

Do I need to reboot when I make changes to php.ini?

Thanks.

tgus

____________________________
Families can be together forever...
 
If you are running PHP as an Apache module (which I recommend), then you have to stop and restart Apache for changes in php.ini to take effect.

If you are running a stand-alon PHP interpreter, then you probably don't have to do anthing after saving your changes.

Want the best answers? Ask the best questions: TANSTAAFL!
 
I think it is running as an Apache module. Because When I stopped and restarted Apache, I noticed a change took place.

But how do I fix my original error?

Thanks.


tgus

____________________________
Families can be together forever...
 
Insufficient data for a meaningful answer.

&quot;A change took place&quot; is an extremely nebulous description of a problem.



Do you have the LoadModule and AddModule commands necessary in httpd.conf to load PHP into Apache?

Want the best answers? Ask the best questions: TANSTAAFL!
 
&quot;A change took place&quot; is not a problem. I simply made a change to the include_path, and I saw it take effect after I restarted Apache.

Can you clarify what commands need to be added for LoadModule and AddModule? and where, in the httpd.conf files?

Thanks again!

tgus

____________________________
Families can be together forever...
 
I checked httpd.conf and found this;

AddType application/x-httpd-php .php

and this;

LoadModule php4_module libexec/libphp4.so


The first one I added after the install because the installer didn't do it.

The second one was added automatically with the installer.

Do I need to add/change anything else to fix the errors?

Thanks.

tgus

____________________________
Families can be together forever...
 
Yes I do.

It's the last line in whole list of AddModule's

AddModule mod_php4.c

Does this mean you can make it work?

Thanks


tgus

____________________________
Families can be together forever...
 
Errors?; Nothing visible.

Is there a log somewhere?

BTW: I also tried running phpinfo()
-=================================-
Code:
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>
-=================================-
And I get the same errors.

Does that offer any clues?

If it was a permissions thing. Where and what would I look for?

tgus

____________________________
Families can be together forever...
 
Your Apache error log will be set in a ErrorLog directive that appears in the context of general server configuration (not within a VirtualHost, etc. directive). What I do when I'm having problems with Apache is issue &quot;tail -f <apache error log> &&quot; (to push it to the background) and then try to start Apache.

If it were permissions, with PHP as a module, then Apache would let you know with a fairly specific error.

Want the best answers? Ask the best questions: TANSTAAFL!
 
O.K. I don't get any of that.

Where can I get the right RPM version of PHP that will support Apache 1.3.11 and MySQL 4.0.12? It seems that my version of Caldera OpenLinux is very similar to RH in it's file structure. Would a RH RPM work for me? Do they make generic RPM's so I don't have to worry about the correct system?

I'm getting desperate. It's taking me way too long to start working on a project. It's not your fault.

It would help if I could just figure out how to find RPM's. And understand which is the right one for my system.

tgus

____________________________
Families can be together forever...
 
All Linuxes are similar in their file structure.

For RPMS, Try:
or

You might also look on your install CDs. If you don't have them, you can get ISO images for them here:
I recommend dumping your current version of Apache. That old version you're running has security holes in it.


Want the best answers? Ask the best questions: TANSTAAFL!
 
Hi sleipnir,

Is this the one I can use?;


I think I found a link for Apache 1.3.9 but it might only be source. I'll have to look at it. Is 1.3.9 ok? I'm not going to 2.x.

Thanks again!


tgus

____________________________
Families can be together forever...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top