Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Is it possible to run a ZF2 application on Resin with Quercus?

55 views
Skip to first unread message

ad...@cloudspace.com

unread,
Feb 20, 2014, 10:31:13 AM2/20/14
to caucho-...@googlegroups.com
I am attempting to set up a very basic Zend Framework 2 application to run on
Resin using Quercus as a proof of concept. I'm running into some issues, and I
haven't been able to find any open source examples of a ZF2 application running
on Resin.

I've managed to get PHP working, but I am seeing errors about functionality
normally included by the PHP SPL extension when trying to load my Zend
application. It appears that SPL is not fully implemented by Quercus, so
hopefully there's a work-around I can use if that is the case.

The first error I saw was about a missing function: spl_object_hash. I wrote
a placeholder for this method to get around the error for now (it's pretty
terrible, I know):

if (!function_exists('spl_object_hash')) {
   
function spl_object_hash() {
        usleep
(1);
       
return md5(microtime());
   
}
}

The next two errors were about the missing classes: SplPriorityQueue
and SplStack. I wrote some placeholders for those as well, going by the
documentation here: http://us3.php.net/manual/en/book.spl.php. These
placeholder classes are basically just wrappers for an array.

The error I'm running into now is:

.../library/Zend/ServiceManager/ServiceManager.php:456: Fatal Error: Uncaught exception of type 'Zend\ServiceManager\Exception\ServiceNotFoundException' with message 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for Application Location[.../library/Zend/ServiceManager/ServiceManager.php:456]'

I'm not really sure where to go from here.

For reference, I'm using:

- http://www.caucho.com/download/debian/dists/precise/universe/binary-amd64/resin_4.0.38-amd64.deb
- https://github.com/zendframework/ZendSkeletonApplication/tree/2f60f8af002e6b7afc9f47a5e79e038e0baf5e3a
Your Blacklist

Regular expressions are supported, do not use i or g flags.
Preferences
  • Blacklist Enabled
    Toggles this userscript. This will reload the page..
  • Display Messages
    Shows "domain blacklisted" in SERP.
  • RegEx Blocker
    Use regex to block full domain name.
  • Auto Block Malware
    Auto-block sites listed as malware.
  • Blacklist News
    Blacklists google news widget.
  • Blacklist Related
    Blacklists related results.
  • Show Preferences
    Leaves prefs open for debugging.
Import/Export
 

Nam Nguyen

unread,
Feb 20, 2014, 1:34:52 PM2/20/14
to caucho-...@googlegroups.com
On 2/20/14, 7:31 AM, ad...@cloudspace.com wrote:
> I am attempting to set up a very basic Zend Framework 2 application to
> run on
> Resin using Quercus as a proof of concept. I'm running into some issues,
> and I
> haven't been able to find any open source examples of a ZF2 application
> running
> on Resin.

Hi Adam,

To answer your question straight-of-the-bat, Quercus does not run ZF2
because we never tried.

>
> I've managed to get PHP working, but I am seeing errors about functionality
> normally included by the PHP SPL extension when trying to load my Zend
> application. It appears that SPL is not fully implemented by Quercus, so
> hopefully there's a work-around I can use if that is the case.

Quercus implements about 80% of SPL and the other 20% is relatively easy
to add.

>
> The first error I saw was about a missing function: spl_object_hash. I wrote
> a placeholder for this method to get around the error for now (it's pretty
> terrible, I know):

spl_object_hash() was implemented for the upcoming 4.0.39 release:

http://bugs.caucho.com/view.php?id=5623

>
> |
> if(!function_exists('spl_object_hash')){
> functionspl_object_hash(){
> usleep(1);
> returnmd5(microtime());
> }
> }
> |
>
> The next two errors were about the missing classes: SplPriorityQueue
> and SplStack. I wrote some placeholders for those as well, going by the
> documentation here: http://us3.php.net/manual/en/book.spl.php. These
> placeholder classes are basically just wrappers for an array.

Thanks, I added a bug report for this at:

http://bugs.caucho.com/view.php?id=5666

>
> The error I'm running into now is:
>
> .../library/Zend/ServiceManager/ServiceManager.php:456: Fatal Error:
> Uncaught exception of type
> 'Zend\ServiceManager\Exception\ServiceNotFoundException' with
> message 'Zend\ServiceManager\ServiceManager::get was unable to fetch
> or create an instance for Application
> Location[.../library/Zend/ServiceManager/ServiceManager.php:456]'
>
>
> I'm not really sure where to go from here.
>
> For reference, I'm using:
>
> -
> http://www.caucho.com/download/debian/dists/precise/universe/binary-amd64/resin_4.0.38-amd64.deb
> -
> https://github.com/zendframework/ZendSkeletonApplication/tree/2f60f8af002e6b7afc9f47a5e79e038e0baf5e3a
> Your Blacklist

Reported a bug for this at:
http://bugs.caucho.com/view.php?id=5667

I need to go through the demo application to see where's the hiccup.
From my experience, it usually takes a couple of days of full-time
work, but ZF2 is pretty large in scope so it may take longer.

-- Nam
Reply all
Reply to author
Forward
0 new messages