0

I am trying to deploy on server web site (http://webdeveloper.md) developed using zend framework. When I enter the file manager on my account on server there is displayed following structure:

anon_ftp
cgi-bin
conf
error_docs
etc
httpdocs
and other directories.

I deployed my project in httpdocs, so when accessing it, there is displayed the standard zend structure (settings, application, data, etc.). As I understand the path to my website home directory is http://webdeveloper.md/httpdocs/public/index.php . I've tried to insert this path into Document root within hosting settings. Now when I access webdeveloper.md in browser I get error 404 (NOT FOUND).

I believe that the problem is in my .htaccess file. I have nothing changed in it and it contain standard code:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

I've tryed to modify it - added one more row:

RewriteBase /httpdocs/public 

then this:

RewriteBase http://webdeveloper.md/httpdocs/public

then this, instead of the last row:

RewriteRule http://webdeveloper.md/httpdocs/public

Nothing works!

My configuraion.ini loks like this:

[production]
resources.cachemanager.database.frontend.name = Core
resources.cachemanager.database.frontend.options.lifetime = 7200
resources.cachemanager.database.frontend.options.automatic_serialization = true
resources.cachemanager.database.backend.name = File
resources.cachemanager.database.backend.options.cache_dir = APPLICATION_PATH "/../data/cache"
resources.cachemanager.database.frontendBackendAutoload = false
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.view[] =
resources.db.adapter = "PDO_MYSQL"
resources.db.isDefaultTableAdapter = true
resources.db.params.dbname = "database"
resources.db.params.charset = "utf8"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = "***********"
resources.session.save_path = APPLICATION_PATH "/../data/sessions"
resources.session.use_only_cookies = true

date.timezone = "Europe/Chisinau"

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

resources.db.adapter = "PDO_MYSQL"
resources.db.params.dbname = "database"
resources.db.params.charset = "utf8"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = "*********"
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

resources.db.adapter = "PDO_MYSQL"
resources.db.params.dbname = "database"
resources.db.params.charset = "utf8"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = "*********"
vascowhite
  • 18,120
  • 9
  • 61
  • 77
Andrei
  • 83
  • 9
  • What web server is in use? Are you sure it is Apache? – vascowhite Jan 03 '13 at 21:50
  • Typically, you want your domain to map directly to your `public` folder, like you can with a local virtual host or with a VPS. If you are unable to make that happen (as is often the case with shared hosting), then there are some workarounds that you can employ. Check out http://stackoverflow.com/a/3765443/131824 for some ideas. – David Weinraub Jan 03 '13 at 22:30
  • yes, it is definetely apache – Andrei Jan 04 '13 at 17:49
  • To David Weinraub: I have tryed the tutorials. They are developed for shared hosting. My server allows me to change the document root. However I've tryed to act like it doesn't. I set document root in my root directory, copied .htaccess into root directory and changed the code inside it to redirect the page access to index.php from public folder (like it is advised in most of tutorials). But all I get is HTTP Error 500 Internal Server Error: incorrect server configuaration or please contact the administrator. Never thought that it is so hard to deploy zend project on a server. – Andrei Jan 04 '13 at 20:26
  • one more thing: it could be the problem the fact, that all project is stores in httpdocs? The server I use provides its own structure (like is described above) and maybe this fact brings to mess up with paths that are used all over the project? – Andrei Jan 04 '13 at 20:56
  • **Make it relevant to others** - We like to help as many people at a time as we can. Make it clear how your question is relevant to more people than just you, and more of us will be interested in your question and willing to look into it. - http://stackoverflow.com/questions/how-to-ask --- Please do not duplicate your questions only because you got no answer so far. Instead edit your existing question. Also keep in mind that if you need concrete Zend Framework support, it might be a better idea to visit Zend Framework Forums and the Support Section on their website to gather more resources. – hakre Jan 05 '13 at 18:18

1 Answers1

1

I have solved all the issues. Actually, I let .htaccess and index.php files as they are. As I understood from experience of other users, the necessity to edit .htaccess appears in cases when the server doesn't allow to modify Document Root (most common case - shared hosting). This was not my situation, so all I had to do is to edit PHP settings on server. I've done following modifications in PHP settings on server: 1. I changed Document Root to point on my public folder (in my case /httpdocs/public/); 2. in PHP settings on server initially open_basedir was ROOT:/tmp (or something), I've changed this value to DEFAULT; 3. I modified in PHP settings session.save_path and inserted there the path to sessions directory from my zend project. And finally I had to remove all the files and to deploy my project again. To solve all the issues, I have reviewed error logs from server. Good luck!

Andrei
  • 83
  • 9