Problem with upload website developed by Zend Framework

Username (e.g. epiz_XXX) or Website URL

http://matteograzioso.great-site.net/

Error Message

Warning : require_once(library/Application.php): failed to open stream: No such file or directory in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/public/index.php on line 24

Fatal error : require_once(): Failed opening required ‘library/Application.php’ (include_path=‘/home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/library:.:/usr/share/pear/’) in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/public/index.php on line 24

Other Information

I developed my website with Zend Framework (version 1.12.20) and i’m trying to upload it on infinityfree, but unfortunately i have this problem.
Who can help me? Have i post the code of the files htaccess, index.php or other?

in the public folder, is there a folder called library?

else it would be
require_once "../library/Application.php"

1 Like

Thanks friend!
But unfortunately, now the problem is this one:
Warning : include_once(Zend/Config/Ini.php): failed to open stream: No such file or directory in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Loader.php on line 134

Warning : include_once(): Failed opening ‘Zend/Config/Ini.php’ for inclusion (include_path=‘/home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend:.:/usr/share/pear/’) in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Loader.php on line 134

Fatal error : Uncaught Error: Class ‘Zend_Config_Ini’ not found in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Application.php:404 Stack trace: #0 /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Application.php(87): Zend_Application->_loadConfig(‘/home/vol3_1/ep…’) #1 /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/public/index.php(29): Zend_Application->__construct(‘development’, ‘/home/vol3_1/ep…’) #2 {main} thrown in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Application.php on line 404

Really, i don’t know how can i solve :frowning:

Does the folder exist? (Zend), also, is the file name correct? Can you screenshot this if you think everything is correct.

1 Like

If you can, try editing the file where the problem occurs. PHP is quite fussy about file paths.

Make it something like this:

include_once(__DIR__ . 'Zend/Config/Ini.php');
1 Like

This is the code of the file Application.php at line 404:

The directory of my project is this:
2

And the file index.html is into the folder “htdocs”

That makes it a bit harder to find. What’s in your index file?

This is index.html:

<html>
<head>
<title>TODO supply a title</title>
<meta http-equiv="REFRESH" content="0;url=./T2019/public/">
</head>
<body>
<div>TODO write content</div>
</body>
</html>

And this is the file “index.php”:

<?php 

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 . '/../Zend'),
    get_include_path(),
)));

require_once APPLICATION_PATH . '/configs/app.php';
$APP_CONFIGURATION['environment'] = 'dev';

require_once '../Zend/Application.php'; 

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

Ahh right. You need one or the other. Take the contents of your index.html and add it to your index.php file. Delete your index.html once you’ve done that.

3 Likes

Wait, you are telling me that I have to merge this 2 index file (e.g.: i add the .html file to the .php file) and delete one of them (e.g.: delete .html file).
How can i merge this 2 files?
Thanks a lot for all friend!!

That is basically what i’m saying yes. Change the contents of your index.php to this:

<?php 

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 . '/../Zend'),
    get_include_path(),
)));

require_once APPLICATION_PATH . '/configs/app.php';
$APP_CONFIGURATION['environment'] = 'dev';

require_once '../Zend/Application.php'; 

$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()->run();
?>
<html>
<head>
<title>TODO supply a title</title>
<meta http-equiv="REFRESH" content="0;url=./T2019/public/">
</head>
<body>
<div>TODO write content</div>
</body>
</html>

I also want you to rename your index.html file to something index.html.old, just so it is out of the way.

2 Likes

Ok, but now where do I put the new index.php file? In which directory?

The main one, htdocs.

Friend, now it doesn’t work.
The error is 500 and on the address appears /?i=1 near the link.
Can you help me, please?

An 500 Internal Server Error means that either you have invalid .htaccess rules, or your PHP application crashed. Here is an article which may help you get started on fixing this:

4 Likes

The result is this:
Warning : require_once(/configs/app.php): failed to open stream: No such file or directory in /home/vol3_1/epizy.com/epiz_27131371/htdocs/index.php on line 20

Fatal error : require_once(): Failed opening required ‘/configs/app.php’ (include_path=‘:.:/usr/share/pear/’) in /home/vol3_1/epizy.com/epiz_27131371/htdocs/index.php on line 20

but i don’t know how can i solve :frowning:
The code of my file index.php is this:

<?php 

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 . '/../Zend'),
    get_include_path(),
)));

require_once APPLICATION_PATH . '/configs/app.php';
$APP_CONFIGURATION['environment'] = 'dev';

require_once '../Zend/Application.php';

$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()      
            ->run();
?>
<html>
<head>
<title>TODO supply a title</title>
<meta http-equiv="REFRESH" content="0;url=./T2019/public/">
</head>
<body>
<div>TODO write content</div>
</body>
</html>

In your screenshot of FileZilla I don’t see a configs folder, but your index.php file seems to be referencing it.

Can you please verify that your website code actually works, and that ALL files have been uploaded?

6 Likes

Warning : include_once(Zend/Config/Ini.php): failed to open stream: No such file or directory in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Loader.php on line 134

Warning : include_once(): Failed opening ‘Zend/Config/Ini.php’ for inclusion (include_path=‘/home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend:.:/usr/share/pear/’) in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Loader.php on line 134

Fatal error : Uncaught Error: Class ‘Zend_Config_Ini’ not found in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Application.php:404 Stack trace: #0 /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Application.php(87): Zend_Application->_loadConfig(‘/home/vol3_1/ep…’) #1 /home/vol3_1/epizy.com/epiz_27131371/htdocs/index.php(29): Zend_Application->__construct(‘development’, ‘/home/vol3_1/ep…’) #2 {main} thrown in /home/vol3_1/epizy.com/epiz_27131371/htdocs/T2019/Zend/Application.php on line 404

Now the problem come back this… :frowning:
Help me please!! My code is working before this changes :frowning:
Thank you in advance!

It seems most of your files link to each other, in Zend/loader.php, you need to redo the directory path to Zend/Config/Ini.php