From Creative Commons
Revision as of 19:57, 3 May 2009 by Fourstones (talk | contribs) (Blank Screen On Upload)
Jump to: navigation, search

Docs Home Install Upgrade Troubleshoot Customize Admins Devs Content Query Templates Commands Skins

Known Issues

Please consult our bug tracker for the latest list of unresolved issues.

Blank Screen On Upload

PHP is notorious for returning a completely blank screen when uploading a file fails under some circumstances. Unfortunately those circumstances are hard to track down because of this lack of error reporting.

The most common reasons have to do with file access conflicts in Apache as well as memory allocation and other settings in your PHP configuration.

For ccHost 5.1 (in SVN only as of this writing) you can check your installation by browsing to /ini_settings.

Otherwise these settings should be sufficient:

  • file_uploads On (1)
  • upload_max_filesize 10M
  • post_max_size 10M
  • memory_limit 10M
  • max_execution_time 120
  • max_input_time -1

If you are still having problems, to make sure that uploading works on your installation, copy the following code to test_upload.php in your root installation and browse to /test_upload.php :

  function print_form()
  <form enctype="multipart/form-data" action="test_upload.php" method="POST">
  File: <input name="uploadedfile" type="file" /><br />
  <input type="submit" value="Upload File" />
  function upload_file()
    if( empty($_FILES) )
        echo "No files to upload";
    $target_path = "content/admin/" . basename( $_FILES['uploadedfile']['name']); 

    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
        echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
        " has been uploaded ";
        echo "<a href=\"" . $target_path . "\">download</a>";
    } else{
        echo "There was an error uploading the file, please try again!";

Note that the code above assumes your content upload directory is called content and that you have a user called admin. Edit the code above to conform to your installation if these assumptions are not correct.

If the upload did not succeed then the problem is definitely in your operating system or PHP environment and not in ccHost.

If the upload did succeed there might be a problem with you getID3 installation. To test that possibility you'll need to edit a file within the ccHost installation called cchost_lib/cc-fileveryify.php In that file at about line 143 there is a line of code that looks like:


You'll want to put two forward slashes in front of that line so it looks like this:

       // CCDebug::QuietErrors();

Now try your upload using the ccHost submit forms. If there is a problem with your getID3 installation, then the errors should lead you to what the solution is.

IE8 Layout Issues

Some of the screens in some of the skins are problematic for Internet Explorer 8.

The easy way to prevent these problems is to force "compatibility" mode using a meta tag in the skin.

To do this:

  1. Browse to admin/templatetags/profiles
  2. For the %(extra-meta)% field enter the following:
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

File Access

By far the most common issue with new installs on Unix based systems involves file access permissions. The recommended way of dealing with this is to set the entire ccHost directory structure as all-access (0777) just while you get things going. If everything else is working then you should follow the ccHost file access guildlines.

Outputting Debug Messages

Debug messages are special messages that help ccHost developers troublshoot your site when there is a problem. The option to turn on debug message output is on by default in 5.0 installations and upgrades. The file that controls this option is <your_local_files>/lib/DEBUG.php. You can remove this file (or change the extension to something other than .php) and that will turn the option off debug output for your production site.

Variable Dumps

You can dump various records and environment variable at any time, right onto the screen.

First, you must enable debug mode as described above.

Then, as long as you logged in as admin, on any page browse to:


That will list out all the global variables available to you (the user record is the currently logged in user).

To view the first record of the current page's Query API record results:


In other words, you can append dump_rec=1 to almost any URL to see what the Query API is returning:


That will list out all the variables in a given upload record (the user record here is the one that uploaded the thing).

To dump the internal dataview use dpreview=1 instead.

Developer Dumps

ccHost developers have several options for dumping specific variables and getting state information.

All of these assume that debug mode has been enabled somewhere:


For dumping a variable to the screen:


For sending text to the log file determined at admin/paths:


To dump a variable to the log use:

 CCDebug::LogVar( $text, $var );

Since ccHost is event based it's not always to figure "how I got here." For an abbreviated stack trace:


For a full blown (very expansive) version:

 CCDebug::StackTrace( false, true );

Repairing a broken configuration (A.K.A. HELP!!!!)

If you get into 'trouble' with your system you might be able to salvage your site by browsing to one of these URLs:

  • <your_root_installation>/admin/edit
  • <your_root_installation>?ccm=/media/admin/edit
  • <your_root_installation>/cchost_lib/cc-config-repair.php

If you are not logged in as an administrator when trying this you will have to:

  • Open the cchost_lib/cc-config-repair.php file in a text editor
  • Remove the two forward slashes // before the word 'return' in the line at the top of the file
  • Save this file to disk
  • From your browser, go to <your_root_installation>/cchost_lib/cc-config-repair.php. (This should bring up a configuration editor)
  • Click on the word media to open the configuration settings and see if you can spot the error
  • After you have fixed (or decided you can't fix) the problem make sure to the put the // back into the cchost_lib/cc-config-repair.php file otherwise you will leave a large gaping security hole in your site