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 wOOdy-Soft 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...
 
You can probably use that RPM, but you will need a bunch of other RPMs to support it. Take a look at the requires list.

The most recent version of Apache in the 1.3.x series is 1.3.27. And I agree with you -- PHP and Apache 2.x sometimes do not play well together.

Want the best answers? Ask the best questions: TANSTAAFL!
 
And I agree with you -- PHP and Apache 2.x sometimes do not play well together.
How have you noticed? I haven't noticed any problems as of yet and I've been using it for a long time now (6+ months).

//Daniel
 
Well, for a start there is the warning which reads:

Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows.

at

There is also personal experience. I've set up 4 LAMP boxes in the last 4 months -- aside from the size of the hard-drive and the amount of RAM in the systems, the machines were hardware identical. My success rate is running about 50% when installing Apache 2.x and PHP 4.3.x from source. Unfortunately, I haven't been able to tell where I've been going wrong in the installation, either.

Want the best answers? Ask the best questions: TANSTAAFL!
 
Sure, I've read the warning. I just haven't understood why the warning is there as I have found no problems with it, except for the versions mismatch (the Apache API was rewritten between 2.0.39 and 2.0.40).
I've personally installed Apache 2 and PHP on several machines, with completely different hardware, without any other problems than the versions.

//Daniel
 
It's great to see such good info going back and forth.
I obviously don't have any real experience using Apache x with PHP x. And I really don't know what the issues are. I found out they don't work or play well together here;


And here;


I'm trying to get one of these phpBB forums setup on my home Linux PC so I can play with it and learn. But so far I keep running into all these road blocks.

I just heard about this one, what do you think about it?;


sleipnir, you said I could use that rpm but I would need more rpms to go with it.

Can you or someone tell me, what is the best (and easiest) way to get my system upgraded with all the pieces I need? (MySQL 4.x done, PHP 4.x, and Apache maybe)

Thanks!

tgus

____________________________
Families can be together forever...
 
O.K. never mind about phpdev5. It looks like that's just a windoz package. That won't work!

Anyway, can someone tell me how to find the right stuff I need?
Just a link to a site that can tell me what I need to know would be fine. Someone must know this stuff who's willing to share.

Thanks again!

tgus

____________________________
Families can be together forever...
 
What I generally do is try to install the RPM I want. If the package depends on other libraries, I do additional searches at rpmfind to get packages which contain the needed libraries.

Unfortunately, I always install PHP from source, so I don't know exactly how many times you will have to do that.

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

Sorry. I've just been scratching my head over this.

O.k. so you say you always install PHP from source.

I think you saw the link with the instructions I followed for my installation.

Is that what you do? Did I miss a step? What do you do different?

Do you think I should uninstall my current version of Apache and PHP? Try to find the latest 1.3.x rpm of Apache and install the RPM of Apache and then try PHP again?

Would you be willing to help me find the right stuff for Apache?

Sorry for being so new at this. I'm really learning a lot. And I'm trying to learn it as fast as I can. As I learn, I try to give back and help others when I can!

Thanks again!

tgus

____________________________
Families can be together forever...
 
I recommend that you start from scratch on the installation. Get your older Apache version out of the way and try again.

I follow the basic source install instructions available on the website, but with enhancements. I activate a lot more parts of PHP and Apache than their stock install does.

Want the best answers? Ask the best questions: TANSTAAFL!
 
tgus,
I run php4.1.2 & apache1.3.23 from redhat distro. Also php4.x with apache2.x on another machine - again rh distro. Here's a link that provides links to download & install the components:

I also bought a book:pHP & MySQL by Wellington and Thomson which containes source & binaries for apache, php & MySql, beside being a good resource. I'm not doing anything on the sql side yet, but it's listening for when I eventually get there. Hope this helps.

Just a side note - I don't get php to fire inline inside a .html file. I believe I could change apache to fix that in the .conf file. But it works fine if my html calls php or I use the 'file/open' in ie.
 
rouse01,

I give you a S T A R !!!

I read your &quot;Just a side note ...&quot;
I made a quick .htm file to call my hello-world.php file. It FAILED! It wouldn't load, got a 404 error!

Turns out, the permissions were not set for anyone but the owner to read the file, (my fault) I didn't realize I needed to chmod the files I put in /home/httpd/html directory. I guess I assumed you put the files in there and their public.

While the problem you mention is not the same as mine. It got me to look in the right place. That's why I gave you a star!

BTW: you say you use these RH packages, but you don't say what you're using them on. Are you using Redhat, or something else?

Thank you!

sleipnir,

I gave you a STAR too! Not because you fixed my problem, but because you tried. You were persistant and hung in there.
Sometimes though, I wish your answers were more complete.

Thanks for the help guys!

I'll be back!

tgus

____________________________
Families can be together forever...
 
Thanks tgus, I actually struggled with putting in that side note, because I'm also new to php/web. I'm glad you figured it out (ricochet)!
If you hang here you'll find sleipnir & daniel among the top-guns. They've helped me alot.

Cya 'round
Keith
 
rouse01,

You're welcome! Never hold back that info. It just might be the bit of info someone needs. (like me)

I had been looking for that answer for about two weeks. And without the answer I couldn't move on to the next phase. I had even tried looking at other forum sites. To no avail.

Yes, I am quite aware of the help you can receive here. I think daniel has helped me some and sleipnir has helped me on and off for quite a while now.

I've looked at a lot of forum/boards and so far, there isn't another one that has as much variety (in topics) and as many knowledgable people. The board itself could stand an overhaul (upgrade or replace) though.

tgus

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

Part and Inventory Search

Sponsor

Back
Top