Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Apr 2007
    Posts
    57

    Default Allowing Full URL PHP Includes?

    I'm currently using PHP 5.2.1 on Apache 1.3.7 on CentOS 4.4. The problem I have is that I can't allow Full URL including via PHP. Example:


    Code:
    <?include("http://file.txt"); ?>

    And after checking my PHP.ini, "allow_url_fopen = On" is what I find in my configuration. What do you think the error for this case is? Do I set the on to TRUE instead and see?
    I own/administrate Parasyte Hosting, web hosting service. Sign up today for free/paid hosting!

  2. #2
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    Did you actually read what you just posted?
    Code:
    http://file.txt
    That's not a valid URL !!!!!!

  3. #3
    Member
    Join Date
    Apr 2007
    Posts
    57

    Default

    You're not understanding my post. that's the whole url to a text file. If you're here to evaluate what I posted, then you're not helping in any way.
    I own/administrate Parasyte Hosting, web hosting service. Sign up today for free/paid hosting!

  4. #4
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    Quote Originally Posted by Parahosting View Post
    You're not understanding my post. that's the whole url to a text file. If you're here to evaluate what I posted, then you're not helping in any way.
    No, that is NOT the whole url and I understand your post perfectly ...

    If you are are going to reference a file for include on the same server as
    the script that you are executing, you would pass by path and file reference:

    Code:
    include("/home/mylogin/public_html/file.txt");
    If the file you are including is located on another server or web site,
    then you need to use the URL including the web address:

    Code:
    include("http://www.targetdomain.com/file.txt");
    Instead of either of the above, you put the following:
    Code:
    include("http://file.txt");
    That is not a valid URL! The "http://" tells the PHP parser that the
    included file is going to be pulled from the internet but there is nothing
    but a filename passed after that so your PHP parser has absolutely
    no idea where it is supposed to connect to on the web!

    You can't just pass a filename without a web address if using "http://" !!!

    If you are just going to put a filename only then you need to drop the "http://"

  5. #5
    Member
    Join Date
    Apr 2007
    Posts
    57

    Default

    Alright then, it's an example. So as for my problem, what do you think I can do as a solution?
    I own/administrate Parasyte Hosting, web hosting service. Sign up today for free/paid hosting!

  6. #6
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    The problem is, your example was badly broken and would never have worked. We suspect that the broken URL is the problem, not the server settings.

    So, what is the URL you're trying to use? Change the domain name if you like, but leave everything else exactly as it is.

  7. #7
    Member
    Join Date
    Apr 2007
    Posts
    57

    Default

    Code:
    <?include("http://www.targetsite.com/top.txt);?>
    It says Full URL opening is not allowed on the server. I don't have the error no more, but if I did I would show it. This has nothing to do with file existence, because I checked and found the file being existent.
    I own/administrate Parasyte Hosting, web hosting service. Sign up today for free/paid hosting!

  8. #8
    Member
    Join Date
    Mar 2006
    Posts
    1,215

    Default

    Add this under your allow_url_fopen = On directive to keep it neat...

    allow_url_include = On

    restart apache of course.

Similar Threads & Tags
Similar threads

  1. cp includes: possible to include a php file?
    By RSimoes in forum cPanel Developers
    Replies: 5
    Last Post: 11-19-2008, 10:47 AM
  2. php includes from remote url is not working
    By fireineyes in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 12-15-2007, 04:16 AM
  3. php includes
    By sv1 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-18-2007, 10:19 AM
  4. Replies: 4
    Last Post: 11-30-2004, 06:28 AM
  5. php problems? with includes?
    By ryno267 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-25-2004, 04:39 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube