I just installed Zend Framework, when I try to open a website that was created with that framework I get the error below.
I know the problem is that the library is not included as I checked some other questions before... Here is what I did to try to resolve it but it's still not working. An important thing to note is that the files are working on an other computer. So it's not coming from the code.
Warning: require_once(Zend/Application.php): failed to open stream: No such file or directory in C:\\data\\trunk\\www\\public\\index.php on line 68
Fatal error: require_once(): Failed opening required 'Zend/Application.php' (include_path='C:\\data\\trunk\\library;;C:\\data\\trunk\\www\\application;C:\\xampp\\php\\PEAR') in C:\\data\\trunk\\www\\public\\index.php on line 68
I did a symlink between:
C:\data\trunk\library\ZendFramework-1.11.9\library and
C:\data\site.local
I also did a symlink for:
C:\data\trunk\library\ZendFramework-1.11.9\extras\library and
C:\data\site.local
In my index.php (C:\\data\\trunk\\www\\public):
set_include_path(implode(PATH_SEPARATOR, array(
realpath(dirname(__FILE__) . '/../../library'),
realpath(dirname(__FILE__) . '/../../common'),
realpath(APPLICATION_PATH),
get_include_path(),
)));
require_once 'Zend/Application.php';
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
EDIT:
So I found a file that confirmed that I should be using Zend-1.12.3. I also found a txtfile saying " to point library files to the site.local directory. This is where the zend library is located".
I found a file in site.local
Name: Zend
Content: link /Sites/_library/Zend-1.12.3
I found 2 files in trunk/library :
Name: Zend
Content: link ../../site.local/Zend
Name: ZendX
Content: link ../../site.local/ZendX
This is my new architecture if I follow what is written:
C:\\xampp3\\htdocs\\mywebsite
site.local
Zend-1.12.3
ZendX-1.12.3
Your problem is definitely a path problem...
I can see from your paths above that the library is located in C:\\data\\trunk\\library\\ZendFramework-1.11.9\\library
, not sure about what you wanted to achieve with your symlinks here. The class you are looking for in the code is Zend_Application
( Zend/Application.php
) and therefore php will be looking in all the locations defined in your include_path
whether a Zend/Application.php
file exist and whether it contains a class named Zend_Application
.
If you rename the library folder from ZendFramework-1.11.9
to ZendFramework-1.11.9
that should be almost ok (there should not be a library folder inside of it though...). Maybe inside of the ZendFramework-1.11.9/library
folder you have a Zend
folder, that would be the one you need in your include path. Same thing for the extra lib (I seem to recall it mainly provides resources and ZendX libraries).
You definitely need to understand the concept of include_path
. Do not hesitate to use print_r(explode(';', get_include_path())); exit;
print_r(explode(';', get_include_path())); exit;
to understand what your include_path contains. Any question come back and ask!
The problem clearly comes from wrong paths and include path.
As we do not know where the libraries are fetched from, I will explain using versions we can find online. Beware: I do not know whether the libraries you have have been edited, sometimes bad developers tend to do that... Please do a diff on your libraries and mines before interchanging them...
So we know the project is under the following document root: C:\\data\\trunk\\
According to your logs, include_path='C:\\data\\trunk\\library;;C:\\data\\trunk\\www\\application;C:\\xampp\\php\\PEAR'
, meaning we can load any classes from C:\\data\\trunk\\library
.
Let's now focus on the C:\\data\\trunk\\library
folder.
You can download this library from Github for ZF 1.12.*, but according to your first message you are on 1.11, so you can retrieve packages from the official website: https://framework.zend.com/downloads/archives
Fetch the version you use, full version: https://packages.zendframework.com/releases/ZendFramework-1.11.9/ZendFramework-1.11.9.zip
Then open the zip file, and retrieve only the folders you need. You need to copy and paste library/Zend
and extras/library/ZendX
into your folder C:\\data\\trunk\\library
. That should be all you need really
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.