PHP Includes - Post ID 156

User 37670 Photo


Registered User
2,138 posts

I just had a look at the Ipowerweb website. If I had not read your post I would have no idea that there was an issue with php or server side includes. Their website says that they support all of that, and give an increadible 6GB of webspace for a reasonable price.
I got this from their list of things they claim to support:
CGI-BIN
Perl Support
MySQL
PHP 4 & 5 Support
Server Sides Includes

From that, I would be shocked if my .php includes and other php scripts stopped working. That is false advertising.
E-Learning Specialist
www.mainsites.ca is my website, and yes, some of it is crappy.
User 364143 Photo


Guest
5,410 posts

They won't care. You don't like it, you move on. Unless you are willing to fall on your sword over the issue.
CoffeeCup... Yeah, they are the best!
User 2733 Photo


Ambassador
426 posts

*sigh*

I'm sorry I wasn't more clear in my post. If your host is iPower you will suffer from the exclusion of the allow_url_fopen function if you attempt an URL reference like this:

include("http://www.somesite.com/somefile.php");

However, if the files are stored on the same server space, this reference will work fine:

include("/www/server/htdocs/somefile.php");

I hope that's a bit more clear. Please see this wiki entry from Dreamhost that sums it up succinctly.
Let's not get all hurt.
User 355448 Photo


Ambassador
3,144 posts

Tom wrote:
He sure can. Unless you think you may be getting tens of thousands of requests a day.

Are you talking about a server room in his house or a data center?

Tom,

My son-in-law is setting up an office in a building that was a house. The house is being stripped down to the bare studs and getting new electrical service. I will be doing the phone and network wiring (maybe some other as well). I haven't seen the floor plan yet, but there will be one room where I install a patch panel and switch. That location will also have a file server, and some type of interface with the outside world communications. I am just starting to study this subject, so I may be asking some simple questions.

I guess the answer to your question is similar to having a web server in a home, but it will have business service of some sort. I just don't know right now what type of service is needed.
User 37670 Photo


Registered User
2,138 posts

Dave Sellers wrote:
*sigh*

I'm sorry I wasn't more clear in my post. If your host is iPower you will suffer from the exclusion of the allow_url_fopen function if you attempt an URL reference like this:

include("http://www.somesite.com/somefile.php");

However, if the files are stored on the same server space, this reference will work fine:

include("/www/server/htdocs/somefile.php");

I hope that's a bit more clear. Please see this wiki entry from Dreamhost that sums it up succinctly.

Dave,

This might be over-simplifying it a bit, but wouldn't this work if the files are local?
<?php
include("somefile.inc.php");
?>

If the path is kept simple, it might work no matter what url fopen is set?

Just a thought.
E-Learning Specialist
www.mainsites.ca is my website, and yes, some of it is crappy.
User 2733 Photo


Ambassador
426 posts

Cliff Main wrote:
Dave,

This might be over-simplifying it a bit, but wouldn't this work if the files are local?
<?php
include("somefile.inc.php");
?>

If the path is kept simple, it might work no matter what url fopen is set?

Just a thought.

Cliff,

That would work if the files were in your site's root directory. However, if you were in say

http://www.mysite.com/media/

your suggestion would not work UNLESS somefile.inc.php existed in the /media/ directory as well OR you wrote the include like this

include("../somefile.inc.php");

This presents a new problem as some hosts see this ../ directive as the root of the server which you cannot access as a customer.

When we write includes using absolute to root

include("/www/server/htdocs/myfile.php");

it matters not what our working directory is as the path to the file is "absolute to root", or absolute to the server root directory. You know, the one you can't access using ../ from the root of your site.

Let me explain this way.

http://www.yoursite.com
include("../somefile.inc.php"); // BAD REFERENCE

http://www.yoursite.com/media/
include("../somefile.inc.php"); // GOOD REFERENCE

http://www.yoursite.com/media/ OR http://www.yoursite.com
include("/www/server/htdocs/somefile.inc.php"); // BEST REFERENCE

That was verbose. Sorry.
Let's not get all hurt.
User 364143 Photo


Guest
5,410 posts

billr,

The reason why I ask is that if you want to run a home web server using a dynamic IP address, there are services that enable you to do this and still resolve the DNS lookup.

One example is http://www.no-ip.com/ which is free for private use and charge a fee for business use.

It will save you a few bucks a month if you don't have to upgrade your ISP package.
CoffeeCup... Yeah, they are the best!
User 355448 Photo


Ambassador
3,144 posts

Tom,

Thanks for the pointer to no-ip.com.

I don't think my son-in-law will go for something like that. I may have read it wrong, but it sounds like you have to use a .on-ip.com sub-domain for your site.
User 364143 Photo


Guest
5,410 posts

That's cool. With the No-IP Managed Plus, you can use your own domain name. It's $24.95 a year, though.
CoffeeCup... Yeah, they are the best!
User 355448 Photo


Ambassador
3,144 posts

Tom,

I have bookmarked the site, and will discuss it with my son-in-law.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.