fellow codeigniters, I’m moving my local ci site onto a media temple server and I’m having a problem with the location of the system and application folders.
the structure of the server is as follows:
../domains
/mysite.com
/html
html is the root of my domain. i.e this is where i’d go when i access www.mysite.com
I placed the ci system folder (ci_system) under domains.
since the html folder is being used by a few ‘under construction’ files, I created a subfolder called ‘mysiteapp’ under html and placed my application folder, idex.php, css, js folders there.
so it looks like this:
../domains
ci_system
/mysite.com
/html
/mysiteapp
/application
/css
/assets
/js
index.php
I edited the index.php file so that $system_folder = “../../../ci_system”;
the problem is, when I access the site, i get a php error:
Warning: require(../../../ci_system/application/config/constants.php) [function.require]: failed to open stream: No such file or directory in /nfs/c08/h04/mnt/xxxxxx/domains/ci_system/codeigniter/CodeIgniter.php on line 52
so it looks like the ci_system folder is being located however CI is still trying to locate the application folder off of the ci_system folder.
I have tried specifying the full path the the application folder but it still tries to concatenate the 2 together.
I have not done many ci installations and my local one was done months ago and i don’t remember it being a pain. so I’m not sure where to look to fix this problem.
hope someone can help.
thanks
Ok So the index.php file does have the $application_folder var which can be set and pointed towards the application dir. Could you be kind enough to share the index.php file? You may have to set both up .. i.e the system folder path and the application folder path.
And the only problem I noticed with your system path is that its relative when the CI doc states that you have to use full server paths...
It is possible to move your application folder to a different location
on your server than your system folder. To do so open your main
index.php and set a full server path in the $application_folder
variable.
$application_folder = "/Path/to/your/application";
If you do want a quick fix, and have shell access, create a sym link, that should fix it quickly, but its just cutting around the corner.
What is inside your ci_system directory? Do you see directories like core, database, libraries etc.?
According to your warning message, you have codeigniter in /domains/ci_system/codeigniter, or you have wrong settings in your index.php.
Related
I have a Joomla 2.5 development website www.mysite.com/dev. It is ready to migrate and replace the old site in root folder. Someone suggested to zip the entire subdirectory, delete the root joomla files, extract subdirectory files to root then edit the configuration php.
But how about the database? Do I need to change anything? If not, does that mean both dev and live will be linking to the same database? Will that cause a problem?
The physical location of the files in your web space is independent from the connection to the database so you can move the files to another folder and Joomla will usually work just fine.
It's possible that the development and live website point to the same database but this would not be the best way to create a new development website unless they use different prefixes. You can see which database Joomla is connecting to in Global Configuration > Server or in the configuration.php file.
You will also need to update the paths to the tmp and logs folders in Global Configuration.
You may need to update the $live_site parameter in the configuration.php file if it has been specified.
You may also need to update the .htaccess file in case any absolute or relative paths are specified in there.
When I make a development website live, I usually copy all the files and folders in the root of the website (except the /dev folder) to /old and then move everything from /dev to the root folder. You then have the old website available if needed for a while.
If you move your site from the /dev/ folder to the root folder, you don't have to change the settings for your database. The database connection will still work just fine.
I would, however, suggest to remove the files from the /dev/ folder once you're done to avoid a penalty for duplicate content. :)
I have an umbraco installation that uses imagegen.ashx.
I would like to deploy it using octopus deploy, this is pretty simpel and is already working.
My problem is that octopus deploys to a new folder (with a version number) each time, which imposes a problem with the media folder, since it can be changed in every folder.
I have made a shared folder at the same level as the versions, and I have made a virtual directory in IIS.
If I access the files directly through a browser - they exist and everything is fine.
But if I use imagegen.ashx it does not work, I have tried setting the imagebasedir property like so:
<Class Name="default" OverridesQueryString="true">
<AllowUpsizing>false</AllowUpsizing>
<MaxHeight>800</MaxHeight>
<MaxWidth>800</MaxWidth>
<ImageBaseDir>D:\Octopus\Applications\customer Test\customer\Shared\ </ImageBaseDir>
</Class>
What am i doing wrong?
ImageBaseDir is unlikely to expect a server mapped path.
The imagegen documentation shows examples that are either relative to the site, or from a fully-qualified url from another site.
Mapping to a path outside of your webroot will likely cause permissions issues for a number of reasons i wont get into here...though i see that you have set up the Media folder as a virtual directory. Good start, however it appears that you're mapping to the d:\ drive instead of the virtual directory you set-up (Presumably this is /Media ?).
You may also look into how the imagegen "Cached" folders are respected by your Octopus set-up. If the imagegen generated images/files get munged, that's a no-good-situation that could leave you with the appearance of missing images:
/(media-virtual-directory)/99999/Cached/index.xml could state that the generated image is # "df1rt0lr.png" -but if that got removed in the deploy process you'll see the missing image behaviour.
Have you used the AltImage property to specify a fallback to a known, always available image? This will help tell if imagegen is throwing errors before outputting your expected result.
I don't believe it's an imagegen issue however, it's a pretty mature product and it's well put together as well being well documented. I would look at using a relative path for ImageBaseDir - or better yet, not using this attribute at all but rather just having your /Media folder being in a constant location as your virtual directory.
I am starting to work on some incomplete stuff in codeigniter. I had to install codeigniter on my machine. I have the source code files from the previous work, however I am confused how to move these files to CodeIgniter folder to access them as usual and start working on them.
I am not sure which files go to which folder in the CodeIgniter Folders available when downloaded.
Download and install Codeigniter on your machine first. Check out in which folders the controllers/models/views/configs reside.
Then you will have an idea which files reside where, if you still have some problems take a peek in the documentation.
CodeIgniter have and system a application folder.
I'd recommend a new download.
I doubt some change was made on system folder, so I think you can ignore it from your project and use the new downloaded one
The project is on the application and there you have some folders, as mentioned by gopi1410, that you need to take care, maybe there are libraries, models, controllers, configurations files, autoload, etc.
And tell us what it the version of you application. If it is a old version, there will be some problem using the new version system folder.
I have installed Codeigniter 2.1.0 locally, it works great.
But when I upload it to my provider I first get:
Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php
I can fix this by changing index.php:
$system_path = "system";
$application_folder = "application";
to (why? I never had to do this...)
$system_path = dirname(__FILE__) . "/system";
$application_folder = dirname(__FILE__) . "/application";
But then I get:
Fatal error: Call to a member function item() on a non-object in <path>/Utf8.php on line 47
I can comment out the line but I then get similar error somewhere else.
Please, is this problem at my provider? Or am I doing something wrong? I used CI before and it worked elsewhere flawlessly.
PS: Please not this is completely fresh install of CI.
Yes and no,
the problem is that your provider has probably different web server settings than you do. If he does, you have to adapt the settings, that fits the needs.
The main root cause of this problem is the variety of styles that can express path in the file system. *NIX systems uses forward-slash for expressing folder structure. On Windows machines its a back-slash.
The *NIX systems have root of the file system "/", Windows machines has C:/, D:/ etc...
Every file system has different settings of access rights and their management.
On most of the UNIX systems works locating of the path without a trouble. So if codeigniter tries to determine absolute path of the directory where is CI located, from the "so called" relative directory, he will succeed. If not, it can't work because he don't know where are the files it wants to load.
There are also many bugs across the PHP versions. Eg. there is reported bug with PHP 5.2.0 and Windows Apache that (with certain rights on the directory) the is_dir() function returns False even if the directory is present and it should (and on the other system will) return True.
The most certain way to ensure the path is loaded correctly is to give the CI absolute path. The absolute path varies on OS and eg. on UNIX is /var/www/domain.com/system, on Windows "who knows?". But there is a way how to determine it easily.
Create index.php file in the root folder you can access with this content inside:
<?php phpinfo(); ?>
If you load the page there will be (among other things) stated the absolute path in row with:
_SERVER["DOCUMENT_ROOT"] | /var/www/mydomain.com/
Now if you will assign the absolute path to the $system_path variable it should be sufficient. For greater certainty also assign $application_folder variable.
Note that the path to system folder has to be to the system folder of code igniter and path to application folder has to be to the application folder. So for example:
$system_path = "/var/www/mydomain.com/system";
$application_folder = "/var/www/mydomain.com/application";
After that your site should work flawlessly.
(there are some mentions about this on user guide: http://ellislab.com/codeigniter/user-guide/installation/index.html)
I am currently developing a joomla 1.5 based site in a temp subdomain (which points to a subfolder on ther sever where all joomla stuff is installed). Currently I am using plugins joomgallery an kunene 1.0.9 (legacy mode).
Once the development is done I would like to move the whole site into the root directory and delete the whole subdomain. How would this ideally be done? Can I just move the files or is there more to it? Any common pitfalls to watch out for? E.g. Are there absolute paths referenced somehwere?
In your configuration.php file, the base path might be defined, something like this:
var $live_site = 'http://temp.mysite.com/';
...though I think by default now, it automatically detects this value for you.
Check in the configuration of your custom components to see if they have got the paths "hardcoded" in there too.
Another thing you could do is set up a .htaccess file with some RewriteRules so that any call to http://temp.mysite.com gets redirected to http://www.mysite.com
There is a free Joomla! extension for this called Joomlapack. Just make a backup with Joomlapack, move the backup files that was created to the new site/folder and run the script that also was created in the backup. Done!
Joomlapack makes a complete backup on both the DB and site files so you can move your site anywhere if you wanted. Joomlapack can be found here: http://www.joomlapack.net/
Make sure to edit your configuration.php file as per these instructions.