Page 1 of 5 123 ... LastLast
Results 1 to 10 of 44
  1. #1
    Join Date
    Oct 2006
    Location
    UK
    Posts
    25
    Plugin Contributions
    0

    Default Fatal error: main() Failed opening required '' in tpl_index_default.php

    I have just suddenly started getting this error message (amongst others) on my site (www.t3tuning.co.uk).:

    Fatal error: main() [function.require]: Failed opening required '' (include_path='.:/usr/lib/php') in /home/t3tuning/public_html/shop/includes/templates/template_default/templates/tpl_index_default.php on line 42

    Its running v1.2.5 of zencart, and is a mature site having been up for a while. I haven't changed any files recently, so it must be a change on the server of some sort.

    The line in question is:

    HTML Code:
    <td class="plainBox"><?php require($define_main_page); ?><br /></td>
    ..and it looks like "$define_main_page" is not defined on that page. It must be defined somewhere, but what could have changed on the server that could have broken this mechanism?

    I have searched the forums, and people have had some similar problems (like http://www.zen-cart.com/forum/showthread.php?t=47585), but no definate solutions. I am getting no help from my hosting co, and am getting desparate!

    Thanks, Chris

  2. #2
    Join Date
    Oct 2006
    Location
    UK
    Posts
    25
    Plugin Contributions
    0

    Default Re: Fatal error: main() Failed opening required '' in tpl_index_default.php

    Anyone know the answer??

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error: main() Failed opening required '' in tpl_index_default.php

    Your permissions on your /includes/languages/english/html_includes files are too low, causing them to not be readable, and thus the error.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Oct 2006
    Location
    UK
    Posts
    25
    Plugin Contributions
    0

    Default Re: Fatal error: main() Failed opening required '' in tpl_index_default.php

    I don't have an html_includes directory in /includes/languages/. Should there be one in my version of zencart? I have lowered all permissions on everything in the /includes/languages/ folder, with no change..

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error: main() Failed opening required '' in tpl_index_default.php

    Quote Originally Posted by sprintstar
    I don't have an html_includes directory in /includes/languages/. Should there be one in my version of zencart? I have lowered all permissions on everything in the /includes/languages/ folder, with no change..
    Well, your code is making reference to "define pages". Those are stored in the /includes/languages/english/html_includes folder.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Oct 2006
    Location
    UK
    Posts
    25
    Plugin Contributions
    0

    Default Re: Fatal error: main() Failed opening required '' in tpl_index_default.php

    Ah well I have an html_includes folder in /includes/languages/english/, but I have set the permissions on everything in the languages folder to 766, with no change. Where does $define_main_page get assigned a value, and what could have suddenly changed on my server to stop this working?

  7. #7
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error: main() Failed opening required '' in tpl_index_default.php

    Did you try 777 ?

    Your template file says:
    PHP Code:
    <?php require($define_main_page); ?>
    and $define_main_page is a variable that is set in the /includes/modules/pages/index/header_php.php around line 49:
    PHP Code:
      $define_main_page zen_get_file_directory(DIR_WS_LANGUAGES $_SESSION['language'] . '/html_includes/'FILENAME_DEFINE_MAIN_PAGE'false'); 
    That is looking for the includes/languages/english/html_includes/mred/define_main_page.php and if it can't find that it will look for includes/languages/english/html_includes/define_main_page.php
    If it can't find either of those then you'll get the error you reported.

    Either that, or your template file uses something other than "$define_main_page" and the header_php.php uses something else; thus the value of the variable is blank, and when the "require()" command attempts to access it, it is forced to try loading a file whose name is blank. Thus the error.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Oct 2006
    Location
    UK
    Posts
    25
    Plugin Contributions
    0

    Default Re: Fatal error: main() Failed opening required '' in tpl_index_default.php

    Yes, its now all 777..

    I have my main page defined here:

    /public_html/shop/includes/languages/english/html_includes/uktemplate/define_main_page.php

    And /includes/modules/pages/index/header_php.php looks as it should, so maybe zen_get_file_directory is not working as it should?

  9. #9
    Join Date
    Oct 2006
    Location
    UK
    Posts
    25
    Plugin Contributions
    0

    Default Re: Fatal error: main() Failed opening required '' in tpl_index_default.php

    Might it be anything to do with my host's php setup?

    http://www.t3tuning.co.uk/phpinfo.php

  10. #10
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,230
    Plugin Contributions
    0

    Default Re: Fatal error: main() Failed opening required '' in tpl_index_default.php

    Your server is running PHP as a CGI module, so the maximum you can set your folders to is 755. Try setting the files in your custom html_includes folder to 600 (user read/write).

    If the errors have started recently on a mature site, it looks like your host has installed PHPSuExec on it's servers. PHPSuExec increases server security by forcing PHP scripts to run as the user, rather than as 'nobody'.

    You will find you have to change permissions on all folders currently set over 755 down to 755, and reduce permissions on all files so they are no longer writable by World. You will also have to remove any php_flag or php_value statements from your htaccess and put them in a php.ini file. You may need the php.ini file copied to other folders too.

    Your host should really have given you advance warning about this change so you had time to make the changes and test them before the changeover.

 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. Fatal Error: Failed opening required 'includes/application_top.php'
    By WeebleSue in forum Installing on a Linux/Unix Server
    Replies: 18
    Last Post: 24 Oct 2007, 03:38 AM
  2. Replies: 4
    Last Post: 18 Jul 2007, 11:53 PM
  3. Replies: 0
    Last Post: 20 Feb 2007, 01:39 AM
  4. Fatal error: main(): Failed opening required
    By MFP in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 13 Oct 2006, 03:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR