Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 958147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:49:01+00:00 2026-05-16T00:49:01+00:00

I’ve built a ZF app using 1.10 for deployment on RHEL server in a

  • 0

I’ve built a ZF app using 1.10 for deployment on RHEL server in a corporate client, which has PHP 5.1.6. It won’t run.

I googled and now realise it’s the version of PHP. I didn’t realise ZF had a minimum requirement for PHP 5.2.4, and calls to HeadLink seem to be causing fatal error “Call to undefined method Zend_View_Helper_Placeholder_Container::ksort()”:

PHP Fatal error:  Call to undefined method Zend_View_Helper_Placeholder_Container::ksort() in /library/ Zend/View/Helper/HeadLink.php on line 321

The client won’t upgrade their PHP; I don’t want to rewrite the app without ZF, and I’d rather not downgrade ZF to a grossly earlier version.

Is there some patch I can use to add ksort() to ZF 1.10 to get around this? There may be other problems, but this is where I’m stuck right now.

Any advice welcome

Many thanks

Ian

EDIT: As I say in a comment below, I expect many people have hit this before and will keep on doing so as RHEL5 will be a standard in corporate environments for a good time to come. I was hoping for a link to an existing solution rather having to devise one from scratch.

UPDATE: I used the patch linked to in the accepted answer and it fixed the problem for me.

This is adding the following public method to Zend/View/Helper/Placeholder/Container/Abstract.php

    /** 
 * Sort the array by key 
 * 
 * @return array 
 */ 
public function ksort() 
{ 
    $items = $this->getArrayCopy(); 
    return ksort($items); 
}

There was one remaining issue; a PHP notice caused by a string conversion in Zend_View_Helper_Doctype. Comparing this function to similar ones above and below, this seems to be an error in the library

public function isHtml5() {
    return (stristr($this->doctype(), '<!DOCTYPE html>') ? true : false);
}

Changed to:

public function isHtml5() {
    return (stristr($this->getDoctype(), '<!DOCTYPE html>') ? true : false);
}

Patching the library itself was the last thing I would normally do, but in this case it got me out of a spot. We’ll make sure the patch is versioned in the repo and documented obviously for future developers.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:49:01+00:00Added an answer on May 16, 2026 at 12:49 am

    I had the same issue today.
    I found solution in this blog post.

    Add the following snippet in /Zend/View/Helper/Placeholder/Container/Abstract.php:

    /**
    * Sort the array by key
    *
    * @return array
    */
    public function ksort()
    {
        $items = $this->getArrayCopy();
        return ksort($items);
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.