Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    13

    Default php includes from remote url is not working

    I recently moved to a new server with the latest redhat and cpanel 11, but thing I noticed is that php no longer allows me to use remote urls in my includes. Here is a my server info...

    http://www.northalabama.net/server_info.php

    The code I was using was

    PHP Code:
    <?php include("http://www.earnsmoney.com/money/index.php?section=serve&id=41&output=html");?>
    Pages that have an include like this just seem to load halfway and then will time-out halfway loaded. The php never displays the external page. Can be any external url that is included.

    This type of php coding worked fine on my Redhat 3 server before. Is there something on the php.ini file or something else I need to look at? Anyone out there know what it could it be?

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by fireineyes View Post
    I recently moved to a new server with the latest redhat and cpanel 11, but thing I noticed is that php no longer allows me to use remote urls in my includes. Here is a my server info...

    http://www.northalabama.net/server_info.php

    The code I was using was

    PHP Code:
    <?php include("http://www.earnsmoney.com/money/index.php?section=serve&id=41&output=html");?>
    Pages that have an include like this just seem to load halfway and then will time-out halfway loaded. The php never displays the external page. Can be any external url that is included.

    This type of php coding worked fine on my Redhat 3 server before. Is there something on the php.ini file or something else I need to look at? Anyone out there know what it could it be?
    Yes, in the php.ini (which BTW has a nifty interface at WHM -> Service Configuration -> PHP Configuration Editor and click on "Advanced Mode"), look at the setting for allow_url_fopen. Often you will see this disabled because of the enormous security risk this functionality can pose when you're not careful about it. If you want to include remote URLs, set this setting to On

  3. #3
    Member duranduran's Avatar
    Join Date
    Apr 2004
    Posts
    198

    Default

    Quote Originally Posted by cPanelDavidG View Post
    Yes, in the php.ini (which BTW has a nifty interface at WHM -> Service Configuration -> PHP Configuration Editor and click on "Advanced Mode"), look at the setting for allow_url_fopen. Often you will see this disabled because of the enormous security risk this functionality can pose when you're not careful about it. If you want to include remote URLs, set this setting to On
    Hi, i have this two lines in my php.ini:

    allow_url_fopen = On
    allow_url_include = On

    And the include (using URL) dont work

  4. #4
    Member handsonhosting's Avatar
    Join Date
    Feb 2002
    Location
    Omaha, NE
    Posts
    150
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    I've found that putting it into the master php.ini file does not work.

    If you make a custom php.ini file inside your /home/user/public_html folder and put the tags, then it will take effect and work for you.

  5. #5
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by duranduran View Post
    Hi, i have this two lines in my php.ini:

    allow_url_fopen = On
    allow_url_include = On

    And the include (using URL) dont work
    I learn something new every day . Didn't know the PHP crew finally split that into 2 separate settings. I know it was being discussed for a while, just not that it was implemented (apparently done in the PHP 5.2 series once I looked it up). Thanks for the head's up!

    The trick is ensuring these settings are enabled in the correct php.ini (especially with concurrent PHP setups). Currently, with concurrent setups, only the php.ini for PHP 5 is edited when you use the PHP Configuration Editor in WHM -> Service Configuration. QA is currently looking into a way to be able to configure both PHP 4 and 5 with concurrent setups. In the meantime, editing the php.ini for PHP 4 must be done manually with concurrent setups.

    Also, ensure you are editing the php.ini for Apache and not for cpsrvd when editing php.ini manually.

  6. #6
    Member duranduran's Avatar
    Join Date
    Apr 2004
    Posts
    198

    Default

    Quote Originally Posted by handsonhosting View Post
    I've found that putting it into the master php.ini file does not work.

    If you make a custom php.ini file inside your /home/user/public_html folder and put the tags, then it will take effect and work for you.
    Dont work for me. I try all the possibilities.

    This is my apache PHP compilation:
    [/var/cpanel/easy/apache/profile/_main.yaml]

    Apache 1.3.39
    [?] Access
    [?] Actions
    [?] Alias

    [?] AuthnDefault

    [?] AuthzHost

    [?] Autoindex
    [?] CGId required to run CGI scripts or PHP as CGI with threaded MPMs
    [?] DIR
    [?] Expires
    Fileprotect Prevent Users from reading other webroots
    [?] Frontpage
    [?] Headers
    [?] Log Config
    [?] Mime
    [?] Negotiation
    [?] Mod SuPHP Build PHP with "CGI" and "Force CGI Redirect"
    [?] mod_proxy
    Raise FD Setsize
    Raise Hard Server Limit
    [?] Setenvif
    [?] Status
    [?] Unique Id
    [?] Userdir
    [?] Mod Security (requires unique id support in apache) v1.9.5 for Apache 1.3, v2.1.3 for Apache 2.x
    [?] Mod Bandwidth v2.1 for Apache 1.3, v0.8 for Apache 2.x - see URL for details
    [?] Tomcat v5.5.25 Experts ONLY: Do not install this unless you have a tomcat admin.

    PHP 4.4.6
    [?] Bcmath
    [?] Calendar
    [?] Curl
    [?] CurlSSL
    DiscardPath may interfere with running PHP as CGI
    [?] DomXslt
    [?] Exif
    [?] FTP
    [?] GD
    [?] Gettext
    [?] Imap
    [?] Java
    [?] MM
    [?] Magic Quotes
    [?] MailHeaders
    [?] Mbstring
    [?] Mcrypt
    [?] Mhash
    [?] Mime Magic
    [?] Mysql of the system compile mysql support against the system libraries (only option for PHP 4)
    [?] Openssl
    [?] PGsql will break 7.2.x or earlier, please make sure you have 7.3.x or later installed
    [?] Pspell
    [?] SNMP Requires the SNMP Dev libraries to be installed first!!!
    [?] Sockets
    [?] Swf
    [?] TTF
    Versioning [UNSUPPORTED] DO NOT USE THIS OPTION UNLESS YOU ARE EXPERIMENTING
    [?] Wddx
    [?] XmlRPC
    [?] Zip
    [?] Zlib Requires that zlib is installed and up to date

    Now i have other error, if i try to access

    http://jorgeportugal.com.br/portuguesPortugal.php the URL include dont work, and i have files CORE in my www:

    root@server [/home2/jorgepor/public_html]# file core.2279
    core.2279: ELF 32-bit LSB core file Intel 80386, version 1 (SYSV), SVR4-style, from 'php'

    I try to recompile apache-PHP so many times...

  7. #7
    Member duranduran's Avatar
    Join Date
    Apr 2004
    Posts
    198

    Default

    Now i have this error (after a nw apache-php recompilation) when i try to restart apache

    /etc/init.d/httpd: line 96: 11656 Segmentation fault (core dumped) $HTTPD -k $ARGV -DSSL

    maybe a need to run a FSCK ?

    The /etc/httpd/logs/error_log

    [Sat Oct 27 22:31:56 2007] [info] mod_unique_id: using ip addr 67.19.245.34
    [Sat Oct 27 22:31:57 2007] [info] Init: Seeding PRNG with 136 bytes of entropy
    [Sat Oct 27 22:31:57 2007] [info] Init: Generating temporary RSA private keys (512/1024 bits)
    Last edited by duranduran; 10-27-2007 at 07:38 PM.

  8. #8
    Member
    Join Date
    Nov 2004
    Posts
    58

    Default

    I have the same problem.
    PHP 4.4.7
    allow_url_fopen is On

    All my scripts using fopen(URL) and require_once(URL) were working fine, until recently.
    I'm guessing a recent automated Cpanel update broke this functionality.

  9. #9
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Sep 2006
    Posts
    3

    Default

    Without knowing your exact configuration, I will say that I've seen this issue with Zend Optimizer 3.3.0. Downgrade to 3.2.8 and you should be fine.

  10. #10
    Member darren.nolan's Avatar
    Join Date
    Oct 2007
    Posts
    259

    Default

    Quote Originally Posted by highgeere View Post
    Without knowing your exact configuration, I will say that I've seen this issue with Zend Optimizer 3.3.0. Downgrade to 3.2.8 and you should be fine.
    Many people have had this problem with PHP 4 and Zend 3.3.0. We've downgraded Zend to 3.2.2 for PHP4 & left PHP5 with Zend 3.3.0.

  11. #11
    Member
    Join Date
    Aug 2004
    Posts
    200

    Default

    Quote Originally Posted by cPanelDavidG View Post
    I learn something new every day . Didn't know the PHP crew finally split that into 2 separate settings. I know it was being discussed for a while, just not that it was implemented (apparently done in the PHP 5.2 series once I looked it up). Thanks for the head's up!

    The trick is ensuring these settings are enabled in the correct php.ini (especially with concurrent PHP setups). Currently, with concurrent setups, only the php.ini for PHP 5 is edited when you use the PHP Configuration Editor in WHM -> Service Configuration. QA is currently looking into a way to be able to configure both PHP 4 and 5 with concurrent setups. In the meantime, editing the php.ini for PHP 4 must be done manually with concurrent setups.

    Also, ensure you are editing the php.ini for Apache and not for cpsrvd when editing php.ini manually.
    I can't speak for any of the rest of these folks...but I just up'd to apache 2.2/php 5.2.5 completely flawlessly on 7 servers and over 500 sites, the only thing that was botched from the get go was this php include stuff.

    I have to thank whom ever discovered that allow_url_include = On was missing from php.ini, I simply added it bellow the fopen flag and poof it works, everyone is happy again.

    I would like to request you guys get this fix down to the release build asap (hell with new versions flying out every couple hours it shouldn't be hard).

    Cheers!

Similar Threads & Tags
Similar threads

  1. ZendOpt 3.3.0 kills remote includes in PHP 4
    By driverC in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 01-16-2008, 03:08 PM
  2. Upgraded to PHP 5 and simple includes are not working
    By sh4ka in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 12-06-2007, 08:34 AM
  3. remote includes not working?
    By 10101 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-13-2007, 08:40 AM
  4. Avoiding remote PHP includes()
    By Heritz in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-14-2007, 07:21 AM
  5. Allowing Full URL PHP Includes?
    By Parahosting in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 04-09-2007, 06:27 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube