Jump to content

HELP! New host is not allowing me to include PERL scripts in PHP pages


howard-moore

Recommended Posts

I have just bought a new hosting package with Heart Internet. Previously I was with 1and1 Internet. Unfortunately, my new website does not seem to be working with the new host.

 

The problem I am having is that I have a news script in PERL, and I want to have the news results shown on the homepage (index.php). On my old host I used the following code with great success:

 

<?php include ('http://www.twmdebtdirect.com/news/newssmall.pl'); ?>

 

However, you can see the results of this in the new host at www.twmdebtdirect.com. Basically, it is not working at all.

 

I have been told that it is something to do with the php.ini settings, but I am something of a novice, and I have no idea what to do next. Can anyone help please?

 

Thanks,

Neil

Link to comment
Share on other sites

Thanks for the posts. This is pretty much what I thought the issue was (i.e. allow_url_open and allow_url_include settings). I am however a real novice when it comes to PHP. I have managed to create an info file to see the global php.ini settings, but I have no idea how to change these for my directory (I have a shared hosting account, and the host said that they would not change the global settings).

 

Can anyone tell me how to change the php.ini settings (remember I am a complete newbie to PHP!).

 

Thanks,

Neil

Link to comment
Share on other sites

I put this at the top of my index.php file:

 

<?php

 

session_start();

 

ini_set("allow_url_include","On");

?>

 

However, I still got this when I opened the page:

 

Warning: main(http://www.twmdebtdirect.com/news/newssmall.pl) [function.main]: failed to open stream: Connection refused in /home/sites/twmdebtdirect.com/public_html/index.php on line 130

 

Warning: main(http://www.twmdebtdirect.com/news/newssmall.pl) [function.main]: failed to open stream: Connection refused in /home/sites/twmdebtdirect.com/public_html/index.php on line 130

 

Warning: main() [function.include]: Failed opening 'http://www.twmdebtdirect.com/news/newssmall.pl' for inclusion (include_path='.:/usr/share/pear') in /home/sites/twmdebtdirect.com/public_html/index.php on line 130

 

Any more ideas?

 

Thanks,

Neil

Link to comment
Share on other sites

The two settings mentioned are not settable in the script in php5 (please consult the php manual.) It is implied in the manual that they are settable in a script in PHP6.

 

In php5 they are only settable in PHP_INI_SYSTEM, meaning a php.ini or httpd.conf file.

 

If your host allows a local php.ini file and they have not specifically prohibited those settings from being changed, then you should be able to put the statements to set them into a file named php.ini and place it into your root document folder.

 

Check with your web host to make sure.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.