Zend Framework include path error in ubuntu - php

I have developed a Zend Framework application, which works well on xammp and windows. Now I want to transfer this application to a new ubuntu web server. However I get the following warning:
Warning: include_once(Zend/Navigation/Page/MVC.php): failed to open stream: No such file or directory in /var/www/library/Zend/Loader.php on line 146 Warning: include_once(): Failed opening 'Zend/Navigation/Page/MVC.php' for inclusion (include_path='/var/www/application/../library/:/var/www/library:.:/usr/share/php:/usr/share/pear') in /var/www/library/Zend/Loader.php on line 146 Fatal error: Class 'Zend_Navigation_Page_MVC' not found in /var/www/application/ext/views/NavigationCreator.php on line 34
So the Autoloader seems not to find the Zend library classes. My library is really at /var/www/library, my application at /var/www/application. I did sudo chmod -R 777 /var/www to rule out any permission issues.
I know that there are several related posts at SO, but non has helped me so far. Do you have any suggestions how to fix my problem?

Class name should be Zend_Navigation_Page_Mvc not Zend_Navigation_Page_MVC (note the difference in capitalization).
Whenever you move a project from windows system to a linux based one, these are common errors you might get. Because file names are case sensitives in linux. So, always check if the file exists and with the correct case.

Related

laravel on cpanel raise error for autoload_real.php on line 66

I am new to laravel and I run my website on localhost. It runs correctly but when I upload it on cpanel, it raises these errors :
Warning:
require(/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in
/home/didfilei/public_html/app/vendor/composer/autoload_real.php on
line 66
Warning:
require(/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in
/home/didfilei/public_html/app/vendor/composer/autoload_real.php on
line 66
Fatal error: require(): Failed opening required
'/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php'
(include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in
/home/didfilei/public_html/app/vendor/composer/autoload_real.php on
line 66
I solved it. I realized that after extracting the zip file with cpanel, some folders were deleted (eg '/ symfony'), so I got more space from the hosts, then my project extract correctly
Since you do not have access to SSH, you should upload the vendor files along with the rest of your project.
Be careful that if your dev machine is windows, you might face some issues with paths and case sensitivity.
You also need to check how php is executed in your host. You might have to fiddle around with file ownership and access rights.
Especially if suphp is used, your user must be the owner of everything in your folder, all files must be set to 644 and all folders to 755
SSH into your server and run composer update in the root of your project. This will pull in the required vendor files that you are missing.

How to install Zendframework 1 in xampp

So i'm new in zendframework and i want to try zf version 1 , i cannot find a good documentation for this. i'm having an error when i try to run the downloaded file in xampp
here's the screen shot of my folder structure
I install zend framework using composer zendframework/zenframework
then here's the error
Warning: require_once(Zend/Application.php): failed to open stream: No such file or directory in D:\xampp\htdocs\Zend\public\index.php on line 17
Fatal error: require_once(): Failed opening required 'Zend/Application.php' (include_path='D:\xampp\htdocs\Zend\library;D:\xampp\php\PEAR') in D:\xampp\htdocs\Zend\public\index.php on line 17
you should read and understand step-by-step from here :
https://framework.zend.com/manual/1.11/en/learning.quickstart.create-project.html
Or,
https://framework.zend.com/manual/1.12/en/learning.quickstart.html
first try to understand the application structure.
As you are new in Zend framework, I think this is the best place to start.

Repo not working in localhost using laravel

I am new to this but I am trying to view a repository through localhost and I am receiving this php error in the mamp log:
PHP Warning: require ..... failed to open stream: No such file or directory in .......autoload_real.php on line 58
PHP Fatal error: require(): Failed opening required
....autoload_real.php on line 58
On Line 58 is the following:
function composerRequireec02cd7cea0c14cd8638fe929f5e7e81($file)
{
require $file;
}
I think it might have something to do with the laravel version but i'm not sure. The other thing is that when I try to see errors in the laravel log there is no log in app/storage
First give the read permission to storage and bootstrap directory in your laravel project and then reload your laravel project in browser.
It seems to work now after doing composer-dump autoload then a composer update, although I was looking for more of a global answer as to why this might be happening (i.e. outdated laravel version etc.). But thanks everyone!

Pear Packages not working

I've been trying to use a few PEAR packages for a few hours now to no avail. PEAR itself is functioning, and I believe I set all of the configuration variables correctly, but when I try to run any of my packages from the command line, I get PHP errors telling me the required file wasn't found. For example, with phpdoc:
$ phpdoc
PHP Warning: require(PhpDocumentor/phpDocumentor/phpdoc.inc): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40
Warning: require(PhpDocumentor/phpDocumentor/phpdoc.inc): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40
PHP Fatal error: require(): Failed opening required 'PhpDocumentor/phpDocumentor/phpdoc.inc' (include_path='.:/Applications/MAMP/bin/php5.2/lib/php') in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40
Fatal error: require(): Failed opening required 'PhpDocumentor/phpDocumentor/phpdoc.inc' (include_path='.:/Applications/MAMP/bin/php5.2/lib/php') in /Applications/MAMP/htdocs/pear/bin/phpdoc on line 40
I tried manually editing the files, inserting the absolute path to the files, but when I correct one require error a new one just comes up.
This is my pear.conf:
#PEAR_Config 0.9
a:15:{s:10:"__channels";a:2:{s:12:"pecl.php.net";a:0:{}s:5:"__uri";a:0:{}}s:15:"preferred_state";s:6:"stable";s:8:"temp_dir";s:35:"/Applications/MAMP/htdocs/pear/temp";s:7:"bin_dir";s:34:"/Applications/MAMP/htdocs/pear/bin";s:7:"php_dir";s:35:"/Applications/MAMP/htdocs/pear/PEAR";s:7:"doc_dir";s:40:"/Applications/MAMP/htdocs/pear/PEAR/docs";s:8:"data_dir";s:40:"/Applications/MAMP/htdocs/pear/PEAR/data";s:8:"test_dir";s:41:"/Applications/MAMP/htdocs/pear/PEAR/tests";s:9:"cache_dir";s:41:"/Applications/MAMP/htdocs/pear/PEAR/cache";s:9:"cache_ttl";i:300;s:12:"download_dir";s:44:"/Applications/MAMP/htdocs/pear/temp/download";s:10:"http_proxy";s:0:"";s:7:"ext_dir";s:74:"/Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20050922";s:7:"php_bin";s:37:"/Applications/MAMP/bin/php5.2/bin/php";s:10:"sig_keydir";s:39:"/Applications/MAMP/conf/php5.2/pearkeys";}
I'm using MAMP PRO v1.9.5 on Mac OS 10.7.5 with PHP v5.2.17. Also, I installed the packages with the PEAR web interface package manager. If any further information is required, please let me know and I'll post it.
Make sure that the include path contains the folder where PEAR installs php class files. Check your include_path ini setting. It should look like:
include_path=".:PEAR_CLASSES_PATH"
where PEAR_CLASSES_PATH is the pear class path

Zend Failed opening required 'Zend/Loader.php' on Plesk Server

I am getting the following warning and error on a plesk server where I am trying to get the Zend framework working:
PHP Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/mydomain.com/httpdocs/test.php on line 5
PHP Fatal error: require_once() [function.require-once]: Failed opening required 'Zend/Loader.php' (include_path='.:/usr/share/pear:/local/PEAR/:/usr/share/zend') in /var/www/vhosts/mydomain.com/httpdocs/test.php on line 5
I have set the include_path in the php.ini file (/etc/php.ini) to use the directory where I have added the Zend files (/usr/share/zend). This directory then has the framework in a sub-dir called Zend.
I have tried adding a slash to the end of the include_path (/usr/share/zend/).
The path is present when I use get_include_path()
I have tried using set_include_path.
The /usr/share/zend directory has 775 permissions (also tried with 777) and the user and group are both set to root.
I would like to have the framework available to all sites on the server.
I have copied in the Gdata files too and the Zend/Loader.php is there.
Versions:
Framework: 2.0.4
Gdata: 1.12.0
This is the PHP:
require_once("Zend/Loader.php");
I have also tried using:
require_once("/usr/share/zend/Zend/Loader.php");
I am novice plesk/unix user
The things to check for are:
The file exists where PHP is looking for it.
The file is readable by the web server/php_fpm process.
safe_mode is off!
(Putting the information here - so that the question can be marked as answered!)
Zend/Loader.php is for ZF1 and that file don't exists with ZF2 (2.0.4)
Also you need to download the updated version of GData compatible with ZF2
https://github.com/zendframework/ZendGData
If you'll use Composer to setup your dependencies then you should use require_once __DIR__ . '/path/to/vendor/autoload.php

Categories