1

Racking my head as to why I can't include the Zend-framework into my project. The documentation is unclear about how to set up the environment (Or haven't found where it is). Looked at this thread: How to configure Zend Framework on linux machine? but no luck. In the phpinfo() I see Zend configured but why can't I use it? Looked for documentation on how to add this to PEAR/PECL, no luck.

I did see this post: http://devzone.zend.com/article/4683 but still not working

What I have tried:

Option 1

require_once('/usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php'); Zend_Loader_Autoloader::getInstance(); 

Option 2

sudo vi /etc/php5/apache2/php.ini 

changed this line:

;include_path = ".:/usr/share/php" 

to:

include_path=".:/usr/share/php:/usr/share/pear:/usr/share/php/libzend-framework-php" 

restarted Apache

Getting this error:

Warning: require_once(Zend/Loader.php): failed to open stream: No such file or directory in /usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php on line 24 Call Stack: 0.0002 61600 1. {main}() /var/www/webservice/zend/server.zend.xmlrpc.php:0 0.0009 174412 2. require_once('/usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php') /var/www/webservice/zend/server.zend.xmlrpc.php:2 Fatal error: require_once(): Failed opening required 'Zend/Loader.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/php/libzend-framework-p hp/Zend/Loader/Autoloader.php on line 24 Call Stack: 0.0002 61600 1. {main}() /var/www/webservice/zend/server.zend.xmlrpc.php:0 0.0009 174412 2. require_once('/usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php') /var/www/webservice/zend/server.zend.xmlrpc.php:2 
1
  • One often runs into this error, and to quickly troubleshoot it, follow these steps : stackoverflow.com/a/36577021/2873507 Commented Apr 12, 2016 at 15:27

6 Answers 6

1

i would suggest to

chmod 775 /usr/share/php/libzend-framework-php -R as Ran BarZik suggestion . and double check the apache user's permissions .

then symlink it to the your application library by using this :

ln -s /var/www/webservice/library/Zend /usr/share/php/libzend-framework-php/ 
Sign up to request clarification or add additional context in comments.

3 Comments

interesting idea, I might try this. Thanks
Thanks, This ended up working the best for me. Now it's just trying to get the service working
There is now a troubleshooting checklist for this frequent error here : stackoverflow.com/a/36577021/2873507
1

I;ve installed Zend FW on many Linux system and if I encountered problems it was on the include path that was set incorrectly or permission problem.

Maybe the path isn't right, try 'vi /usr/share/php/libzend-framework-php/Zend/Loader/Autoloader.php' or any other text editor that you like. Does it work? Maybe it is permission problem, try to change /usr/share/php/libzend-framework-php/ to 755:

chmod 775 /usr/share/php/libzend-framework-php -R 

2 Comments

Thanks I have validated the path and it's correct as well as the permissions are 775 with root:my user as the owner.
There is now a troubleshooting checklist for this frequent error here : stackoverflow.com/a/36577021/2873507
0

Your main configuration should be in: application/configs/application.ini

This tells the zend controller where to look for the library files etc.

Did you look here when you were installing? : http://framework.zend.com/manual/en/learning.quickstart.create-project.html

1 Comment

Thanks for the reference I will look into it
0

According to the error messages, your updated include_path isn't being picked up.

What does phpinfo() have to say about your include_path?

What if you set_include_path(get_include_path . ':/usr/share/php/libzend-framework-php'); before your include?

I'm assuming here that /usr/share/php/libzend-framework-php/Zend exists...

1 Comment

There is now a troubleshooting checklist for this frequent error here : stackoverflow.com/a/36577021/2873507
0

Try to move zend library:

cd /usr/share/php/libzend-framework-php mv library/Zend /usr/share/php/ 

revert include_path to original:

include_path = ".:/usr/share/php" 

Restart apache

2 Comments

I don't know if this makes sense for me to do but it's an option that I will keep in mind, thanks
There is now a troubleshooting checklist for this frequent error here : stackoverflow.com/a/36577021/2873507
0

After banging my head up against the wall for a couple of days I think I figured it out. Looking at this page: http://devzone.zend.com/article/4683 I understood I needed to add the zend path in the php.ini file. I did this with no effect. After looking at my PHP Configuration I noticed in /etc/php5/conf.d/ I could load zend by uncommenting the library path in the zend-framework.ini file which PHP loads as an additional module/ini

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.