0

Ok so I've searched and searched and nothing that I have found solves the issue. I have a site that was set up locally and then I moved it to a server. I have been trying to set up the Zend library but I just can't seem to get it. Here is my index.php file.

<?php
ini_set('display_errors', 1);

defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application'));

defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') :  'development'));

set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));


require_once 'Zend/Version.php';
echo 'Zend Framework Version = ' . Zend_Version::VERSION;


require_once 'Zend/Application.php';

$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
        ->run();

I keep getting the error message "Warning: require_once(Zend/Version.php): failed to open stream: No such file or directory in /var/www/vhosts/mywebsite.com/directory/index.php on line 17 Fatal error: require_once(): Failed opening required 'Zend/Version.php' (include_path='/var/www/vhosts/mywebsite.com/directory/application/library/') in /var/www/vhosts/mywebsite.com/directory/index.php on line 17"

Any help or guidance would be much appreciated. Thanks,

Updated code and I am now getting this error "Warning: require_once(Zend/Application.php): failed to open stream: No such file or directory in /var/www/vhosts/mysite.com/directory/index.php on line 19 Fatal error: require_once(): Failed opening required 'Zend/Application.php' (include_path=':.:') in /var/www/vhosts/mysite.com/directory/index.php on line 19 "

*Note - My index.php and htaccess file are located in /var/www/vhosts/mysite.com/directory/ rather than the /var/www/vhosts/mysite.com/directory/public/ directory.

Barrett
  • 25
  • 4
  • So I think I might have figured it out. I used the Zend framework 2 library and there is no applicaiton.php file in there. Why is this and is there anything special that I need to do in order to run Zend framework 2? – Barrett Nov 19 '12 at 01:12

1 Answers1

0

the path to library is a level up /../library/

https://github.com/ralphschindler/NOLASnowball/blob/master/public/index.php

Maks3w
  • 6,014
  • 6
  • 37
  • 42
  • I changed out my code with the code from github and now I get the error message "Warning: require_once(Zend/Application.php): failed to open stream: No such file or directory in /var/www/vhosts/mysite.com/directory/index.php on line 19 Fatal error: require_once(): Failed opening required 'Zend/Application.php' (include_path=':.:') in /var/www/vhosts/mysite.com/directory/index.php on line 19 ". – Barrett Nov 17 '12 at 22:42
  • My index.php file is not in the "Pubic" folder tho. I moved the index.php file and the .htaccess file to /mysite.com/directory/ where the application and library directories are located. – Barrett Nov 17 '12 at 22:45
  • Why did you move the index.php and the .htaccess? It's a bad idea!! – markus Nov 17 '12 at 23:06
  • @Barrett I suggest you use the same project dir structure as showed in the link. Is the most popular structure and prevent accidental discloure of internal files – Maks3w Nov 18 '12 at 07:55
  • I see. The reason I changed the structure was because when I went to mysite.com I was getting nothing so I had to use the url mysite.com/public to get the errors. Will the index.php file be executed when users visit the link "www.mysite.com"? – Barrett Nov 18 '12 at 19:07
  • I also get the same error message when I visit mysite.com/public after I move the files to the public directory. – Barrett Nov 18 '12 at 19:11