Support » Themes and Templates » Errors on Theme install

  • Hey everybody,

    I just a finished a new theme for a personal site and while the theme has uploaded and appears to function I got these errors on the upload.

    Warning: fopen(/home1/schmackl/public_html/wp-content/themes/schmackLab-v1.0/style.css) [function.fopen]: failed to open stream: No such file or directory in /home1/schmackl/public_html/wp-includes/functions.php on line 3598

    Warning: fread(): supplied argument is not a valid stream resource in /home1/schmackl/public_html/wp-includes/functions.php on line 3601

    Warning: fclose(): supplied argument is not a valid stream resource in /home1/schmackl/public_html/wp-includes/functions.php on line 3604

    Even though the theme works I am worried about these errors since I installed last week put up a ton of content and then had an explicable data base crash (possibly due to plugins, not really sure).

    I had to delete the database and start over and would like avoid another catastrophe down the line.

    Thanks for you help!

Viewing 8 replies - 1 through 8 (of 8 total)
  • esmi


    Forum Moderator

    Looks like there’s an issue with the theme’s style.css file. Is it missing?

    My css file is present. I had not placed the meta information comments at top but doing so did not solve the problem.

    I found this plugin authors comments regarding the same error under different circumstances.

    A lot of you have commented and e-mailed me regarding an fopen PHP error that occurs during the usage of one of my plugins. The reason for this is because of your PHP configurations, editted by your web host. Your web host must have disabled URL file-access, which is the method I use to retrieve the plugin support link which is displayed on my plugins, which you have an option to enable/disable.

    It took a while, but I’ve released an update to every plugin I’ve released. In this update, I no longer use the fopen command. I use cURL instead, which should solve the problem for the users which have this issue.

    If this is a problem with my host (bluehost) do I need to worry about it?

    Would this have had anything to do with my DB problems mentioned above?

    Thanks for any help.



    Forum Moderator

    That’s unlikely to be the same issue. It’s for a plugin – whilst yours is for a theme which is normally self-contained. And the file it cannot open correctly is schmackLab-v1.0/style.css.

    The meta info at the top of style.css is vital to proper theme operation. You also need to ensure that you do not create or edit the stylesheet in anything other than a plain text editor.

    I write all my code in Coda by hand. The only thing different I’m doing is using @import in my style.css to import a reset.css and a main.css as well as the css for a jquery plugin.

    I’ll try removing the @import and see if that fixes anything…

    No luck with the @import changes.

    This is the code form teh functions.php file that the error refers to starting at line 3596:

    function get_file_data( $file, $default_headers, $context = '' ) {
    	// We don't need to write to the file, so just open for reading.
    	$fp = fopen( $file, 'r' );
    	// Pull only the first 8kiB of the file in.
    	$file_data = fread( $fp, 8192 );
    	// PHP will close file handle, but we are good citizens.
    	fclose( $fp );


    Forum Moderator

    The issue isn’t in wp-includes/functions.php. There’s something wrong in the style.css file. I know it’s not an @import rule as I use them all of the time. My guess is that it’s related to the way in which the file is being saved. Try opening style.css in NotePad and re-saving it.

    i have the same problem with all premium themes, all the css is accurate, has to be the host

    Moderator James Huff


    Contact the company that you bought the premium themes from. Support is part of the package that you purchased from them.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Errors on Theme install’ is closed to new replies.