CI not booting except in the case of 404 responses - codeigniter

I’m up against a very strange issue and am hoping someone will have an idea of what is going wrong here.
I have multiple local CI projects running on a local ubuntu machine, normal lamp stack - they are all fine.
I recently took an svn checkout of a project that I have worked on happily before and cannot see any controller/method even though I get http 200 responses for the request.
If I var_dump $this from a method - I get the name of the controller class - not the CI global object.
If I put in a non-existent path - I get the CI 404 page.
Permissions and apache virtual host settings are good. BASEURL is set correctly.
.htaccess and index.php are working as index.php has been removed from the url and I still can dump strings and natural php functions (like class_exists() etc. ) from a correctly routed controller/method combination. However as soon as the server reaches code that requires CI (such as $this->load->helper() etc. ) processing stops.
I have one small lead - the project that I have checked out works fine for multiple developers where I work. I had to recently rebuild my machine to be native ubuntu 12.04 which before was a wubi virtual box (which died).
In order to var_dump from a controller/method request I had to add a __construct() method to the controller in question in order to be routed to the requested method, otherwise I just get an http 200 response but no var_dump.
The native welcome controller (which still exists in our dev checkout) works in exactly the same manner - in order to var_dump I have to add a __construct() method.
If I add parent::__construct() to the method (in either controller), var_dump no longer works.
My new version of php is 5.3.10-1 with Suhosin v0.9.33. The CI version of the checkout is 2.1.0
So essentially CI is not booting except in the case of a 404. Is there something obvious that anyone can see that I have overlooked?
Thanks.

Did you move from CI 1.7 to 2.1 by any chance? I so I'd check to make sure that you are extending CI_Controller or CI_Model as that's a fairly large change and if I remember correctly the pages will show blank with no error.

Related

Laravel Nova Tag field results in 404 on production

I seriously cannot wrap my head around this.
Locally the tag field of Laravel Nova 4.0 works like a charm (https://nova.laravel.com/docs/4.0/resources/fields.html#tag-field). On production it results in a 404 page on the resource-detail page.
Everything seems to be the same. Same laravel nova version (4.20.2), same data, same other packages.
I've narrowed it down to this call being sent on production:
Request URL: https://api.foodinfluencersunited.nl/nova-api/tags/23a1f0b3-eaac-45c3-b6da-7c1acda08f9d/preview
Which is not sent locally. This call should either not be sent on production (since the tagField has "withPreview" off, or at least it should be sent to:
Request URL: https://api.foodinfluencersunited.nl/nova-api/roles/23a1f0b3-eaac-45c3-b6da-7c1acda08f9d/preview
Since the uuid which is sent is the UUID of a Role-resource.
Does anyone have any idea where I should search for the solution?
I'm trying to at least get the error locally as well.
Imported the production data to local server and made sure that everything else is similar.
It appeared I had out-of-date js on one of my production servers. php artisan nova:publish did not run automatically on one of them. That solved my issue.

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

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

intervention-image with laravel 5.2 on ubuntu-server breaks the other calls

I am using laravel 5.2 to write services for a mobile app. all the calls are working fine. My project is deployed in ubuntu server.
Now I want to resize the uploaded images inorder to maintain same performance. I thought of trying intervention-image.
In local machine it worked fine. I installed intervention-image and set the provider and alias name, I included the alias name to controller. Once I do that and update the server, all the other calls are getting effected. I am getting 505 error.
It's the intervension-image which is causing this problem, I checked with previous upload and I am getting all the calls. Any suggestions?
I suggest you create a dev environment like your production , use vagrant . About error 505 check you error log file to have more detail about the bug

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.

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