Moving Site has broken CodeIgniter Modules - php

I had to move my site to another host and now the codeigniter installation is failing. I've fixed a few problems, but some of my modules break when I try to save changes. The end up going to the following url
admin/index.php/admin/index.php
is that right?

Your paths are relative. Put before an / or write using base_url()

It turned out that the person who had origionally implemented the system had used a differnt bit of code to get the base script for each module, so I had to go through and change each module.
For the admin module it turned out it was to do with changes in how the two differnt versions of php dealt with paths.

Related

All URLs are redirected to index.php

I have setup a Symphony framework on my localhost using this tutorial. I am using the PHP default server and MySQL.
The frontend URL is working fine but when I go to the admin URL (http://localhost:8000/symdemo/admin), then my CSS URL is also redirected to the admin page meaning I am not getting CSS code into the response.
The reason as that the default PHP server does not have a URL-rewriting module and index.php is also adding to the CSS path.
How can I fix this?
I'm not 100% sure, but I think you'll find that using a webserver that supports rewrites is quicker than trying to replicate the necessary rewrites in PHP. Rewrites are listed as a requirement in Symphony CMS's readme, and last time I checked Symphony was still dependent on webserver rewrites for some of its routing/files.
You can, of course, use Apache. If you'd like to use a lighter and cleaner webserver that's easy to configure, I recommend Hiawatha, which has a Symphony URL toolkit/rewrite rule set available.

Joomla component not found

I have a site with a really old version of Joomla, upgrade it or not is not my decision, so I have to work with this version (1.5.15).
The problem is on the site, the home page it's ok, loads all css and js, but when I access to another menu item I get: 404 Component not found, but the component exists, and also the url to access to resoruces (css, img, js, etc) is not correct, for example this is the url www.mypage.com, the url of resources is like /plugins/system/rokbox/themes/light/rokbox-style.css, when I access to another menu item the url is like www.mypage.com/index.php/resource_location.
What can I do? Why is this happening?
There are several options to consider:
Someone made a mistake: and changed the SEF configuration, maybe they just disabled SEF or routing or changed the .htaccess;
Someone attacked your site: pretty easy with your Joomla version.
In either case if you lack documentation or information you need to explore the differences, just load a working backup on a folder i.e. working_backup on the same server and run a diff:
diff -qrwbBE working_backup public_html
This will give you a list of different files, if there are none, go check the plugin configuration maybe a plugin was disabled such as SEF, else open them and see what changed.
If you do not have a working backup, download Joomla 1.5.15 from the Joomla version history site and run the same command, you will get a longer list including any 3rd party extensions; but it's reasonable that the issue lies with core Joomla or a SEF extension, it will be easy to pick it up.
Remember to clear the cache: the error may no longer be there but be cached, and the site might lack permissions to update the cache.

Putting another website along with Zend website

I am working with a website built (not by me) on Zend framework.
I have made a small website (for a Facebook app) built on simple html with custom php (no Facebook API used), which, if put in public/ folder (so that it can be reached via *www.main_site.com/my_small_site*), does not work (I get Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration).
The php.ini on the website, however, contains allow_url_fopen = on, so my guess is that all my php files should be simply put somewhere in the application/ folder, instead of the public/ folder.
The websites don't use shared files, they are independent. And purchasing another hosting is an expensive option.
I am absolutely new to Zend, and learning how to make my own controllers/views will consume too much time, so this is the last option to consider.
How can I solve this problem?
Access .php located in application/ from *public/my_small_site/index.html*? (is it possible without touching the main website's public/index.php?)
Create a new view and put my small website there? (how can I make it accessible from the web?)
Still consider new hosting/subdomain options?
Any other solutions?
Thank you!
public/ is the correct place to put your Facebook app. The error doesn't lie - are you 100% sure the php.ini file you checked is the one being used? I'd suggest you create a phpinfo file as explained here https://kb.mediatemple.net/questions/764/How+can+I+create+a+phpinfo.php+page%3F#gs - this will let you view the configuration PHP is using. See what allow_url_fopen is set to there. If it is set to 'off', there might be a different php.ini file you need to change.
Otherwise, contact your host.

Joomla Admin Side URL Changed from `&` to `&` in URL String [duplicate]

I'm working on my localhost and on a system where all administrator URL's which contain a &, & is changed to & and that in turn breaks the system.
What setting is doing this? What do I need to disable? My localhost is PHP 5.3. I have to mention that other Joomla system's are working perfectly fine and the & in the url are not converted to &.
There is no setting that can do this in Joomla 2.5 (as far as I know).
The only think capable of doing such a thing would have to be a system plugin that will re-encode the URLs.
So my first idea would be to check all the System plugins that may be URL related (like SEF things, or redirect plugins or some routing plug in and so on).
If that fails try to disable all System plugins and see if that fixes the issue.
Another way to test is to get a new fresh Joomla install and add one by one the components that you have on the broken install.
PS: Turns out it was a custom system plugin. (see comments)

How to keep relative filepaths intact, even though I'm bootstrapping

I'm trying to include a premade messageboard, Phorum, into one of my Zend projects. Phorum is a relatively large and intricate web of PHP includes. My website already has a signup, so I'm trying to combine the two login systems into one.
What I've done is to make a controller that includes the Phorum index.php. This will let me use the authentication system I've set up. My problem is that, since I'm bootstrapping, all the relative filepaths within Phorum's index.php seem to try to begin at my Zend project's index.php, meaning they all seem to break.
Is there a way around this? Should I include? Render? Something better?
All help is appreciated.
Adding the appropriate chdir (back to Phorums include path root) in your Bootstrap file should do it. Then you have to of course take care that you Zend App uses application specific and not relative paths.
You can use the include_path setting, which can be set at runtime using set_include_path(). This doesn't require you to change the working directory, but makes PHP search for includes in all the directories specified in this setting.

Categories