Unable to locate the model you have specified - All i did was change servers - codeigniter

I have a codeigniter website, using the latest version of the frame work. I was hosting my website on Azure, and it was working fine - never any issues.
I've just moved all the files to a different server, a linux one - standard normal web hosting type server with cpanel.
My site loads up, however a lot of pages I use that require models, are giving off errors, as if the files do not exist
Unable to locate the model you have specified: UsersModel
Just note : I have read so many articles today, that you need to have uppercase / lowercase and all that stuff, but that's how i already have it setup, it just does not work since changing servers. and it worked perfectly fine yesterday on the Azure server.
Also, when going to the actual file in my address bar, it takes me to the 404 error. not sure if this has anything to do with it?

Did you change your base url in config file ?
All model , controllers, helper ,library name must me capital letter.
If you change server remove index.php from config file where you will get config['index']= ""; and save this.
Still you get error then save base url like domain/project_name/index.php

Related

Prevent apache from replacing fully qualified server name with localhost?

I have installed MAMP on High Sierra, on myserver.mycollege.edu
If I point my browser (chrome) to http://myserver.mycollege.edu/some/path, what shows up in the address bar is localhost/some/path.
And if some/path/index.html contains a link to myserver.mycollege.edu/some/other/page, that gets replaced with localhost/some/other/page
This happens for other users, when accessing my content from their own machine! This obviously fails because their browser is now trying to access a web server on their own machine instead of mine.
So my question is, what is responsible for this URL rewrite, and how do I stop it?
One thing I should have mentioned is that some/path is mediawiki-1.28.1.
The top page served out of that directory is index.php, which will do some config things as part of serving its top level page.
localhost was actually hard coded in LocalSettings.php:
The protocol and server name to use in fully-qualified URLs
$wgServer = "http://localhost";
Replacing with myserver.mycollege.edu fixed the problem.

404 Error in Magento extension when deployed in production

This one is puzzling me for 2 days now. I've found a solution for a 404 in admin, but it is not the same that is happening here. I have exactly the same version of Magento in my local copy and production server: 1.7.0.2. The extension works great in local. I packaged it using Magento Connect and installed in production the same way. All files are there. It shows in the menu and in Configuration section, but when I click the menu to go to the report, I get the beloved 404. I loged out and in, flushed cache zillion times (including deleting the files manually) but nothing changed.This are the URLs in both envs:
(Dev)http://localhost/magentos/index.php/salestaxes/adminhtml_salestaxes/index/key/c4b8ecb58fa2062f696cacfd340/
(Prod)https://www.myserver.com/index.php/salestaxes/adminhtml_salestaxes/index/key/332e617e74a92a39a40cf5d3/
As you can see is exactly the same. I don't know wahy then I'm getting the error. Can somebody point what can I do to solve this? DO I need to check any setting? What can cause this?
This is a var_dump that I get in the router _validateControllerClassName() method:
string(115) "/home_path/public_html/app/code/community/Surpassweb/SalesTaxes/controllers/Adminhtml/SalestaxesController.php"
string(100) "/home_path/public_html/app/code/community/Surpassweb/SalesTaxes/controllers/IndexController.php"
This is the output of Alam's 404 module:
Controller Name
Controller Name: adminhtml_salestaxes
The controller name adminhtml_salestaxes matches the following controller file, but this file does not exist.
home_path/public_html/app/code/community/MyCompany/SalesTaxes/controllers/Adminhtml/SalestaxesController.php
The file is there and has 755 permissions.
This is the first line in may controller:
class MyCompany_SalesTaxes_Adminhtml_SalesTaxesController extends Mage_Adminhtml_Controller_Action {
Thanks for your time.
Are you absolutely sure the file is there? Named the same? With the same character capitalization? And that you're not in a production setup with multiple frontend webservers?
If you'll indulge me — copy the path of the controller from the Better 404 page to your computer's clipboard. Then type
$ ls -l [PASTE]
into your terminal window. My bet if the file won't be there. Also try
$ls -l app/code/community/Surpassweb/SalesTaxes/controllers/Adminhtml/
to see what files are there.
Looking at the information you provided, Magento is looking for a file named
app/code/community/MyCompany/SalesTaxes/controllers/Adminhtml/SalestaxesController.php
I don't know what your actual file is named, but looking at the class name
MyCompany_SalesTaxes_Adminhtml_SalesTaxesController
leads me to believe it might be incorrectly named SalesTaxesControlle.php. Notice the T in sales taxes is capitalized, vs the lowercase t Magento is looking for.
For some reason magento isn't registering the route to your app.
Either apache doesn't know to let magento handle it or magento doesn't know what to do with it.
Check your htaccess files and virtual host configs for the two environments.
Right off the bat I can see they're not exactly the same. One is http and one is https.
Those are probably two different virtual host configs and could be slightly different.
Next I would make sure the config xml for your module is included in magento/app/etc/modules/ folder. Make sure the module is enabled. There should be a line for that in your modules config xml file.
If you deployed it to the local vs community folder, check the magento/app/etc/local.xml and make sure disable_local_modules is set to no.
Good luck. Troubleshooting in live is always fun.

Can't get access to file on localhost under Windows

Periodically after branch downloading from github Yii shows such an issue:
copy(Z:\home\localhost\www\insur\insurance\assets\c75d288a\css\_notes\dwsync.xml) [<a href='function.copy'>function.copy</a>]: failed to open stream: Permission denied
(/_notes/dwsync.xml - is a file created by DreamWeaver automatically for developer's notes).
I can't figure out following:
Why Yii tries to implement copy($path,$dst.DIRECTORY_SEPARATOR.$file); for that file (it's here: [site_root]\yii\framework\utils\CFileHelper.php(130))?
Why an access error is possible on Windows localhost?
What exactly is an error source - Windows, Apache or Yii (or maybe DW)?
What is solution?
So a real Guru needed!
I believe that here is one!
Generally Yii Assets Manager will try to publish (or republish) copies of diffirent resources (img, css, js, ..etc) used by your app (made by you or nativly in the framework, e.g Gii module stuff)
An access error can happen in localhost if you didn't set needed permission to web-server process. But in this exact case i think the web-server can not find the folder from the begining.
It is a joint crime between Yii & Apache. Yii CAssestsManager expects an assets folder, Apache can't find it and complains
Proposed Solution:
Make sure you have a folder named assets in your App Root and make sure it's writable by the web server process!!
To understand more about Yii Assests check this wiki-post

500 error when integrating multiple apps in one code base

I'm trying to set up an MVC application that will service several facebook applications for various clients. With help from Prabir's blog post I was able to set this up with v5.2.1 and it is working well, with one exception.
At first, I had only set up two "clients", one called DemoStore and the first client, ClientA. The application determines what client content and facebook settings to use based on the url. example canvasUrl: http://my_domain.com/client_name/
This works for ClientA, but for some reason when I try any DemoStore routes I get a 500 error. The error page points to an issue with the web.config.
Config Error:
Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'facebookredirect.axd'
I am able to add additional clients with no problem, and changing DemoStore to something like "demo" while using the same facebook application settings works fine also.
Working calls:
http:// localhost:2888/ClientA/
http:// localhost:2888/ClientB/
http:// localhost:2888/Demo/
Failing call:
http:// localhost:2888/DemoStore/
I was thinking this might be an MVC issue, but the Config Error points to the facebookredirect handler. Why would the SDK try to add this value to the config during runtime, and only for this specific client?
Any insight would be greatly appreciated.
I managed to figure out what went wrong here. Silly mistake..
After I had set up the application routes to require the client_name I changed the Project Url in the project properties to point to demostore by default. When I hit ctrl+S a dialog popped up that I promptly entered through without reading.
When I changed the Project Url, IIS Express created a new virtual directory for the project. This was the source of my problem. Why? I'm not sure, but once I removed the second site from my applicationhost.config I was able to access the DemoStore routes.
Moral of the story: read the VS dialog messages!

CodeIgniter Routing / Htaccess / URI issues

I recently joined a team of devs and I'm trying to get an SVN checked out onto my local machine. Unfortunately, I've run into some issues with links and routing. My local machine is using a WAMP setup.
Let's say I have in my controller:
function testfunc()($this->load->view('testfunc');
and in my testview view I have
<li>what we do</li>
At first, I was getting a URL disallowed characters issue. Thumbing through some threads, I added in rawencode($str) and some other things.
Now I get a 404 Page Found error, when the files are clearly there. It appears as though my controller isn't being called, and in turn the view is not called
Any suggestions?
Thanks.
You are missing the controller. Unless you are using some sort of routing, you should be using something like:
<li>what we do</li>
OR
<li><?php echo anchor('controller/testfunc', what do we do);?></li>

Resources