• Resolved macleodjb

    (@macleodjb)


    Hi Guys,

    I wrote a plugin on my local machine running iis. Everything works fine on my local computer. It creates my file and deletes it fine on uninstall. I then copied my plugin to my website and tried activating it and got the error for failed to open stream: no such file or directory.

    Warning: fopen(/home/me/public_html/mysite/wp-content/themes/Small Engine/page-wplc-template.php) [function.fopen]: failed to open stream: No such file or directory in /home/me/public_html/mysite/wp-content/plugins/my-plugin/classes/class-lc.php on line 53

    this is line 53 in my class-lc.php.
    $lc_page_template = fopen( LC_THEME_DIR . ‘/’ . LC_PAGE_TEMPLATE_NAME , ‘w’) or die();

    Again, on iis this line has no issue. It activates and deactivates perfectly fine. Not sure what the problem is. I check my permissions on my website folder for the theme and it is 0755. So i’m stumped. Any help?

Viewing 1 replies (of 1 total)
  • Thread Starter macleodjb

    (@macleodjb)

    My var LC_THEME_DIR was being populated incorrectly.

    I was using get_current_theme() function which was returning the name of the theme not the folder location. For the folder location you have to use the get_template() function.

Viewing 1 replies (of 1 total)
  • The topic ‘failed to open stream: No such file or directory’ is closed to new replies.