The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php includes from remote url is not working

Discussion in 'General Discussion' started by fireineyes, Oct 20, 2007.

  1. fireineyes

    fireineyes Member

    Joined:
    Sep 2, 2007
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    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:
    <?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. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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. duranduran

    duranduran Well-Known Member

    Joined:
    Apr 30, 2004
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    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. handsonhosting

    handsonhosting Well-Known Member

    Joined:
    Feb 17, 2002
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Omaha, NE
    cPanel Access Level:
    Root Administrator
    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. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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. duranduran

    duranduran Well-Known Member

    Joined:
    Apr 30, 2004
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    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. duranduran

    duranduran Well-Known Member

    Joined:
    Apr 30, 2004
    Messages:
    198
    Likes Received:
    0
    Trophy Points:
    16
    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)
     
    #7 duranduran, Oct 27, 2007
    Last edited: Oct 27, 2007
  8. CaMer0n

    CaMer0n Well-Known Member

    Joined:
    Nov 8, 2004
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    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. highgeere

    highgeere Registered
    PartnerNOC

    Joined:
    Sep 4, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    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. djmerlyn

    djmerlyn Well-Known Member

    Joined:
    Aug 31, 2004
    Messages:
    203
    Likes Received:
    1
    Trophy Points:
    16
    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!
     
Loading...

Share This Page