This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

"Failed opening required" error - cgi-bin problems?
#1

Hi all. I am reasonably proficient in PHP and HTML, but I recently became unhappy with one server I was using. I created an account on x10hosting.com, and all seemed to be well until I tried to use the Commentics script. I didn't use it on my old server, but thought it would be good to implement for the new one. The script worked fine during local testing using a PHP module installed in Apache. When I uploaded what I had done to the new server, I got:

Quote:Fatal error: require_once() [function.require]: Failed opening required 'includes/variables/set_variables.php' (include_path='.:/usr/local/php53/pear') in /home/behindth/public_html/comments/includes/commentics.php on line 31

I have searched this forum for similar errors, but I tried the fixes that were posted, except for one integration code post I didn't follow. I didn't see anyone having the problem I was having, so I thought I should post it.

You guys familiar with CGI servers can probably solve this one quickly. My sever has a "cgi-bin" folder, and I've read online posts about having to run PHP scripts from that folder. I really don't understand running PHP as a CGI module. Will I have to run it from that folder? I don't really understand, if so, since my site's pages have a PHP extenstion, and they run just fine.

Anyway, to further try to chase down the problem, I made a script to test to see if the file is there:

PHP Code:
<?php
if (file_exists("/home/behindth/public_html/comments/includes/commentics.php")) {
print
"File exists!\n";
} else {
print
"File does not exist!\n";
}
require
"/home/behindth/public_html/comments/includes/commentics.php";
?>

It prints:

Quote:File Exists.
Access denied.

I am also somewhat mystified that my script does not generate the full error, but the integration code does.

My integration code is:

PHP Code:
<?php
$page_id
= "1";
$reference = "test";
$path_to_comments_folder = "/home/behindth/public_html/comments/";
define ('IN_COMMENTICS', 'true'); //no need to edit this line
require $path_to_comments_folder . "includes/commentics.php"; //no need to edit this line
?>

My commentics script installed just fine, and the server software they are using is called LiteSpeed server.[/quote]
Reply
#2

I saw a post, claiming they were running PHP in safe mode for free accounts; but they deny this. The post that poster was referring to was talking about a popen function that was disabled, and would not be enabled for free accounts. Perhaps they have crippled it? Its PHP version is 3.4.10.1. The permissions for the file it is trying to include, and its parent folders are all 777.
Reply
#3

Hi,

You seem to be using v2.0 but the integration code you posted is for v1.8 and lower. Try this:

PHP Code:
<?php
$cmtx_page_id
= "1";
$cmtx_reference = "test";
$cmtx_path = "/home/behindth/public_html/comments/";
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . "includes/commentics.php"; //no need to edit this line
?>

Have you completed the interview?
Reply
#4

I don't know about CGI, so hopefully the above will work.

It should work because in commentics.php (v2.0) the script tries to include files using the $cmtx_path variable but you don't have that variable in your integration code, you have $path_to_comments_folder, so it's causing a fatal error. Updating the integration code to v2.0 should fix that.

Have you completed the interview?
Reply
#5

That seems to have it. Thx a lot guys! Awesome quick response, too. PHP seems to be running outside of the cgi-bin folder without a hitch just fine.
Reply
#6

BTW: This is bad form, I read:

PHP Code:
<?php 
$cmtx_path
= "/home/behindth/public_html/comments/";

It was just a hack, to make sure it was finding the right path. I am using

PHP Code:
<?php 
$cmtx_path
= "comments/";

and it works just fine.
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by MattyP
11-Apr-2020, 08:08 PM
Last Post by Steven
23-Feb-2014, 06:13 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)