Gossamer Forum
Home : Products : Gossamer Links : PHP Front End :

Error with PHP includes

Quote Reply
Error with PHP includes
I'm having an error running the default_PHP templates. The error can be seen at http://www.servicepals.com/directory/index.php

Basically, getting failure opening files for inclusion - I'm thinking this is because they're .html files in the default_PHP template, not .php files.

Am working on this site over the weekend, and would really like to get it going if possible.

Any ideas?

All the best,

Ross
Code:
PHP Warning: Failed opening 'include_header.html' for inclusion (include_path='') in D:\http\servicepals.com\directory\index.php on line 9 PHP Warning: Failed opening 'include_menu.html' for inclusion (include_path='') in D:\http\servicepals.com\directory\index.php on line 9 PHP Warning: Failed opening 'include_search_bar.html' for inclusion (include_path='') in D:\http\servicepals.com\directory\index.php on line 9 PHP Warning: Failed opening 'include_menu.html' for inclusion (include_path='') in D:\http\servicepals.com\directory\index.php on line 9 PHP Warning: Failed opening 'include_footer.html' for inclusion (include_path='') in D:\http\servicepals.com\directory\index.php on line 9

*-*-*-*-*-*-*-*-*-*-*
Servicepals.com is an online community for serving and retired military men and women. Visit us at http://www.servicepals.com. Development by Rawnet Limited
*-*-*-*-*-*-*-*-*-*-*
Quote Reply
Re: [servicepals] Error with PHP includes In reply to
What script are you running? PHP Frontend should hava a page.php file.
Cheers,
Michael Bray
Quote Reply
Re: [Michael_Bray] Error with PHP includes In reply to
Not running a script - this is just the generated homepage of the directory.

I've set my extensions to be .php, and index files to be index.php

Can PHP <?include?> files with non-PHP extensions?

I'm running PHP okay elsewhere on the site (using vBulletin) - the error showing at that URL I posted relates to an (include_path='') error - what might be causing this? Any ideas?

Cheers for the help,

Ross

*-*-*-*-*-*-*-*-*-*-*
Servicepals.com is an online community for serving and retired military men and women. Visit us at http://www.servicepals.com. Development by Rawnet Limited
*-*-*-*-*-*-*-*-*-*-*
Quote Reply
Re: [servicepals] Error with PHP includes In reply to
Can you post the code from that page?
Cheers,
Michael Bray
Quote Reply
Re: [Michael_Bray] Error with PHP includes In reply to
I've done nothing different - the code is the same as everybody has in the latest download - the default_php templates. This is bloody infuriating - I haven't changed or customised those templates at all, and it's still not working. No idea.

Ah well, maybe there's be response on Monday.

Cheers anyway,

Ross

*-*-*-*-*-*-*-*-*-*-*
Servicepals.com is an online community for serving and retired military men and women. Visit us at http://www.servicepals.com. Development by Rawnet Limited
*-*-*-*-*-*-*-*-*-*-*
Quote Reply
Re: [servicepals] Error with PHP includes In reply to
hmm...
Quote:
(include_path='')
That does look a little fishy. That should include the template_dir/local and template_dir.

In Reply To:
I'm thinking this is because they're .html files in the default_PHP template, not .php files.
I'd have to say it's the include_path that's being the problem more than them being .html files.

I'd like to take a quick peek/do some debugging from the admin if that's possible.


Adrian
Quote Reply
Re: [brewt] Error with PHP includes In reply to
Doing a little digging, I've found out what the problem is. PHP on Windows uses a different delimiter for the include_path than PHP on *nixes (what a pain!). To fix this, try this:
Code:
$_include_path = ini_get('include_path');
$_delimiter = (strtolower(substr(php_uname(), 0, 7)) == 'windows') ? ';' : ':';
ini_set('include_path', "$admin_root_path/templates/${template_set}_php/local$_delimiter$admin_root_path/templates/${template_set}_php");
This should be in Links.inc.php aroun line 211. It currently should be something like:
Code:
$_include_path = ini_get('include_path');
ini_set('include_path', "$admin_root_path/templates/${template_set}_php/local:$admin_root_path/templates/${template_set}_php:.");
Take out those two lines, and replace it with the three lines above.

If you don't feel comfortable doing this, or need any other help, email me (see my profile).


Adrian
Quote Reply
Re: [brewt] Error with PHP includes In reply to
Hi Brewt,

I modified links.inc.php in the admin/links/php folder, did a rebuild of the pages, and still receiving the same error. Frown

Can be seen at, eg, http://www.servicepals.com/...tory/Detailed/39.php

Are there any other files which I would need to change? I wish I could run this on Linux, but for the next 6 months it still has to remain on a Windows 2000 box until the contract expires.

Would be grateful for any further advice how to get this fixed.

Kind Regards,

Ross WIlliams

*-*-*-*-*-*-*-*-*-*-*
Servicepals.com is an online community for serving and retired military men and women. Visit us at http://www.servicepals.com. Development by Rawnet Limited
*-*-*-*-*-*-*-*-*-*-*
Quote Reply
Re: [servicepals] Error with PHP includes In reply to
I think you might want to read my explanation here:
http://www.gossamer-threads.com/...orum.cgi?post=170681

From your url (http://www.servicepals.com/directory/Detailed/39.php), it seems you're trying to build static pages with a .php extension. If you go the static route, you have to use the Perl CGI for the other functions (ie. jump, rate, edit, etc).

On the other hand, when I tried to run page.php on its own, I got this error:
Connection to localhost failed!PHP Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in ...
I'd like to take a look at your Admin if it's possible. Can you email me the login/password? Thanks.


Adrian
Quote Reply
Re: [brewt] Error with PHP includes In reply to
Hi Brewt,

I appreciate your help, but have decided that I should just revert to the old way of doing .cfm pages for the moment, which is working okay now (just need to redo my templates!!).

I was planning a big project to integrate vBulletin, vbPortal (bit like phpNuke) and LinksSQL. However, have decided to put it off until after chrimble or I won't have a very merry time!!

Thanks again for all your help - will be back pestering after the New Year, I'm sure!!

All the best,

Kind Regards,

Ross

*-*-*-*-*-*-*-*-*-*-*
Servicepals.com is an online community for serving and retired military men and women. Visit us at http://www.servicepals.com. Development by Rawnet Limited
*-*-*-*-*-*-*-*-*-*-*