simpli Posted May 26, 2009 Share Posted May 26, 2009 Hi all, I have been doing the quickstart for Zend and I am at the 'create a model and database table' part. I figured all had gone relatively smoothly so far so instead of copy pasting the example I started to adapt it to suit my needs. I also have been reading tons of doc. But I'm still stuck. I have created controllers, models and views ( according to the intructions) when I try to connect to what I think should be the web page I get a 404 error. Exact error is Not Found The requested URL /budgetobjects/companyinfo/ was not found on this server. When I look at my Apache log I see the following error: File does not exist: /Library/WebServer/Documents/budgetobjects/companyinfo and that's right my file is not there. My files are in the following directories: Controller: /library/WebServer/documents/budgetobjects/application/controllers/CompanyInfoController.php View: /library/WebServer/documents/budgetobjects/application/views/companyInfo/index.phtml Model: /library/WebServer/documents/budgetobjects/application/models/companiesInformation.php Model mapper: /library/WebServer/documents/budgetobjects/application/models/companiesInformationMapper.php Can someone tell me what's wrong with my setup? and give me a hint how I can solve this? I'm stuck. Thanks JR Quote Link to comment https://forums.phpfreaks.com/topic/159638-help-cannot-get-to-page-create-model-and-database-table-quickstart-example/ Share on other sites More sharing options...
trq Posted May 26, 2009 Share Posted May 26, 2009 Have you setup your mod_rewrite rules? I just had a look and it seems its now missign from the quickstart. You would need this.... RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php within a .htaccess file within your public directory. Quote Link to comment https://forums.phpfreaks.com/topic/159638-help-cannot-get-to-page-create-model-and-database-table-quickstart-example/#findComment-842201 Share on other sites More sharing options...
simpli Posted May 26, 2009 Author Share Posted May 26, 2009 I definitely don't have that. Can you tell me what it's for and what it does? I will try to do the quickstart exactly like he does and see where that takes me. I thought it had to do with something missing in my configuration. Thanks, JR Quote Link to comment https://forums.phpfreaks.com/topic/159638-help-cannot-get-to-page-create-model-and-database-table-quickstart-example/#findComment-842709 Share on other sites More sharing options...
trq Posted May 27, 2009 Share Posted May 27, 2009 The snippet above configures apache to send all requests for files that don't exist (or end in the mentioned file extensions) to your index.php file. Without it Zend won't work. At least not the default http router anyway. This is what enables urls like http://domain/controller/action to be handled by your application when there is clearly no such file. Quote Link to comment https://forums.phpfreaks.com/topic/159638-help-cannot-get-to-page-create-model-and-database-table-quickstart-example/#findComment-842945 Share on other sites More sharing options...
simpli Posted May 29, 2009 Author Share Posted May 29, 2009 I am having no luck still with this issue. Here's the config on my files. ( I removed comments for space). httpd.conf: DocumentRoot "/Library/WebServer/Documents" <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> <Directory "/Library/WebServer/Documents"> Options Indexes FollowSymLinks MultiViews AllowOverride None Options FollowSymLinks Order allow,deny Allow from all Options Indexes MultiViews AllowOverride AuthConfig </Directory> <Directory "/Library/WebServer/Documents/budgetobjects"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> The important directory for me is /Library/WebServer/Documents/budgetobjects in it I have an .htaccess file with the following: SetEnv APPLICATION_ENV development Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] yet when i try to go to the location http://localhost/budgetobjects/CompanyInfo/ I get a 404 error : The requested URL /budgetobjects/CompanyInfo/ was not found on this server. In my error log I see the following message: /Library/WebServer/Documents/budgetobjects/CompanyInfo. Of course the file does not exist but isn't Zend supposed to translate this into the proper path to go to my index.php? Thanks for any help. JR Quote Link to comment https://forums.phpfreaks.com/topic/159638-help-cannot-get-to-page-create-model-and-database-table-quickstart-example/#findComment-844840 Share on other sites More sharing options...
trq Posted May 29, 2009 Share Posted May 29, 2009 Of course the file does not exist but isn't Zend supposed to translate this into the proper path to go to my index.php? No. Apache needs to be configured to pass all requests to your index.php script, Zend takes over from there. Looks to me like your trying to run a Zend framework application from within a subdirectory of your document root. You need to tell Zend about this. See here. Quote Link to comment https://forums.phpfreaks.com/topic/159638-help-cannot-get-to-page-create-model-and-database-table-quickstart-example/#findComment-845344 Share on other sites More sharing options...
simpli Posted May 30, 2009 Author Share Posted May 30, 2009 Isn't that the normal way to go? we have the webserver directory and one subdirectory for each project right? I followed the page but I have no idea how to implement what's there. Maybe it's too late. I'll see after a night's sleep if I get any further. Thanks again, JR Quote Link to comment https://forums.phpfreaks.com/topic/159638-help-cannot-get-to-page-create-model-and-database-table-quickstart-example/#findComment-845426 Share on other sites More sharing options...
trq Posted May 30, 2009 Share Posted May 30, 2009 Isn't that the normal way to go? I wouldn't think so. I at minimum use a new virtual host for each project I undertake. Quote Link to comment https://forums.phpfreaks.com/topic/159638-help-cannot-get-to-page-create-model-and-database-table-quickstart-example/#findComment-845541 Share on other sites More sharing options...
simpli Posted May 30, 2009 Author Share Posted May 30, 2009 Creating a virtual server has been my strategy as well but I dont think it was working. I didnt want to spend too much time fixing it though but I think it caught up to me. I think I need to start over. Imma start a new thread to fix my virtual server problem and maybe it'll solve my ZF problem as well. JR Quote Link to comment https://forums.phpfreaks.com/topic/159638-help-cannot-get-to-page-create-model-and-database-table-quickstart-example/#findComment-845671 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.