Embeding Image into Contet - Crash (V3.4.2)
  • Hi

    I have installed a fresh campsite 3.4.2 on a shared hosting. It's OK and running well, but as I'm going to embed any attached image into article body via WYSIWIG editor, there is always a crash.

    any suggestion please?

    Sincerely Yours,
    Jim
  • 12 Comments sorted by
  • Hi Jim,

    What specific browser/version and platform are you using?


    On Thu, Aug 26, 2010 at 4:35 PM, gafnoo
    <campsite-support@lists.sourcefabric.org> wrote:
    >
    > Hi
    >
    > I have installed a fresh campsite 3.4.2 on a shared hosting. It's OK and running well, but as I'm going to embed any attached image into article body via WYSIWIG editor, there is always a crash.
    >
    > any suggestion please?
    >
    > Sincerely Yours,
    > Jim
    >


    --
    Holman Romero
    Senior Software Engineer, Sourcefabric
    holman.romero@sourcefabric.org

    Salvátorská 10
    110 00 Praha 1, Czech Republic
    +420 607 133 896

    http://www.sourcefabric.org
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    Could you check that issue on http://campsite-demo.sourcefabric.org? There is installed 3.4.2 for test proposes.
  • Dear Holman & Andrey

    I'm using the latest version of "Mozilla Firefox/3.6.8" and my hosting spec is as:

    * System: FreeBSD cgi9 6.2-RELEASE-p12
    * Server API: CGI
    * PHP Version: 5.2.2
    .....

    (It's a Netfirms business plan Shared hosting. What specific info do you want to know?)


    Also I've tried the Demo mentioned by Andrey. By that I can not even reach the point I want(embedding the attached image to content); during image upload there was an error reporting to thumbnail image creation. even though it's not related to this topic I mention it below:
    "The system is unable to write to the directory '/var/www/campsite-demo/images//thumbnails/'. Please check if the user 'www-data' has permission to write to the directory '/var/www/campsite-demo/images//thumbnails/'. "

    Sincerely Yours
    Jim
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    gafnoo wrote on Thu, 26 August 2010 18:37
    Dear
    "The system is unable to write to the directory '/var/www/campsite-demo/images//thumbnails/'. Please check if the user 'www-data' has permission to write to the directory '/var/www/campsite-demo/images//thumbnails/'. "


    ah, it was done for security reason. Ok, it allows now to upload images.
  • Dear Andrey

    I passed it in the provided demo site. It was OK! But in mine the same problem insist. I don't know what to do!
    I've checked the log files either but there is no error.

    (If your interested in finding the cause, it would be appreciated to take look at it directly sir: here are the info to enter: http://hekmat.chwou.com/admin' and user name and password are both the same is ''admin')

    Sincerely Yours
    Jim
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    hi Jim,
    I've tested your instance. It's not a browser problem. It looks like server php issue. May be not enough memory. Please run script with code
    <?php phpinfo(); ?>
    and attach output here
  • Hi Andrey

    Thanks for your help and interest.
    The php info been attached.

    Sincerely Yours
    Jim
  • Dear Andrey

    I should mention some facts about my installation:

    1- I've placed my own php.ini file in every sub directory to overwrite the shared hosting setting as to the ones required by campsite.

    2- Also I've bypassed the CLI checking in the "CampInstallationView.php" file to pass the first step of campsite installation.

    3- I've removed the 'php_value output_buffering Off' line from the 'htaccess' file because my shared hosting wasn't able to resolve it. As I looked at my phpInfo, that param was zero(0) by default. So I put the 'php_value output_buffering Off' in my custom 'php.ini' file and update it through all of the site hierarchy(sub-directories).

    Sincerely Yours
    Jim
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    hi Jim,

    please remove all custom php.ini files. "Output_buffering Off" is used just for backup/restore process via admin interface.
  • Dear Andrey

    Thanks you for your response and caring.
    I've done what you said (removing Output_buffering setting from my custom php.ini), but the problem persists!!!

    I am so confused!! It should be a simple problem;

    I'm looking forward for your answer.

    Sincerely yours
    Jim
  • Dear Andrey

    Even if I'm not a php developer, I've traced the Issue and finally I found the cause:
    It is due to "preg_replace_callback' method call for image tag replacement; after reaching this point it is not going further and hang on it!!!!

    As it is been stated before, my host php version is 5.2.2. And for the guys who is master in php, it would be so easy to find the rest!!

    I read something in php site; commented by people stating that this method is not recommended for nested HTML tags. (http://php.net/manual/en/function.preg-replace-callback.php)

    I'm looking forward :~
  • Vote Up0Vote Down Andrey PodshivalovAndrey Podshivalov
    Posts: 1,526Member, Administrator, Sourcefabric Team
    hi Jim,

    unfortunately I can not find any reason why it could be. The function which called by preg_replace_callback hasn't any specific function calls. May be it requires more deeper debugging: to resolve this issue on your hosting we need to know where exactly is generating exception. preg_replace_callback calls the function transformImageTags in classes/ArticleData.php file.