How do I set up Code Igniter if my public html folder is a soft link? - codeigniter

I am setting up Code Igniter. My public html folder is a soft link to another folder on my server.
Hence, my directory structure looks like
README errors.txt license.txt system
application html user_guide
where html is a soft link to another folder /var/www/myPublicHTML/. html contains my index.php file.
Code Igniter currently issues this error.
Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php
However, I did specify this in my index.php file within the html soft link / folder.
$system_path = '../system';
$application_folder = '../application';
Why is this error still surfacing? I feel that it may be a soft link issue. Thank you.

The directory that the system symlink points to should permit access to all users. The webserver is probably attempting to access the system directory but doesn't have the proper clearance to do so (Note that the webserver doesn't use your user credentials to do its work).
If the system symlink points to /var/www/frameworks/CodeIgniter/2.x.x/system you should see to it that /var/www/frameworks/CodeIgniter/2.x.x/system is accessible to all users in order to allow the webserver to access that directory as well.
Running chmod 755 -R /var/www/frameworks/CodeIgniter/2.x.x/system should grant read and execute access to ALL users (and full access to yourself). Needless to say that you should enter the path to your system directory in the above command ;).

It should be work by default. if not write full path
$system_path = '/var/www/myPublicHTML/system';
$application_folder = '/var/www/myPublicHTML/application';

hi i got the similar problem after a little research i got to know that as i have installed xampp in different folder under c drive which is xampp1 thats why it was getting error so i supplied full path in config.php file which is
$system_path = 'C:/xampp1/htdocs/project/application/system';

Related

Issue with ExpressionEngine caching file permissions

I am trying to allow caching for my site using expressionengine 2.0. In my config.php file, I have set the following two parameters:
$config['cache_driver'] = 'file';
$config['cache_path'] = '';
Initially there was no cache directory, so I created a cache directory with 755 permissions. However, on expressengine's admin page, when I try to set caching to File, it keeps on saying in a writing next to it in red:
Note that my cache directory doesn't have anything in it. Its at the correct path
www/mysite/system/expressionengine/cache
Any help would be much appreciated
cache folders must need permission of 777. If your path is correct and config vars are correctly defined, you just need to give 777 permission to cache folder.

public_html folder invisible

I have a website which I copied to this location. The public_html folder was also uploaded with the other folders but it is not showing up. Please guide me. Thanks.
As you are using DreamHost web hosting you wont have any control over ssh and chmod , chown commands. I think dreamhost wont use cPanel for shared hosting, they have their own control panel, so there is nothing you can do, Ask dreamHost support to reinitialize your public_html directory. Surely they will do that. I searched on dreamhost forum and found these link-
https://discussion.dreamhost.com/thread-13646-post-13647.html#pid13647
https://discussion.dreamhost.com/thread-128630.html
Currently in your case i saw that there is no issue related to public_html (technically "Document Root" ) directory coz as your http://www.inspuratesystems.com/second/ is pointing to correct directory , and your documentRoot is parent of that directory, So if your documentRoot was wrong then there were no chance to access that that url, currently your domain is opening a correct index.html file which indicates that your documentRoot is there.
Create a index.html or home.html file there manually (from their web based file manager) and see if it is working or not, if it works then there is some issue with your uploading.
Your hosting provider seems to be dreamhost.com
Please check out this thread, according to which public_html seems to be a special case on dreamhost:
https://discussion.dreamhost.com/thread-144453.html
and/or this:
Getting a 'Not Found' error on my website?
Hope it helps!
Make sure that the public_html folder has execute permissions
chmod a+x public_html
That will allow execute permissions for everybody.
Perhaps it's possible that server (apache?) hides folders named public_html? Also check that group others have read and execute permissions for that folder.
In folder /path/to/second/ run
chmod ugo+rx .
chmod -R ugo+rx public_html
to set folder visible.
cpanel may handle the "public_html" folder in a unique way. Try uploading to a folder like: /home/yourusername/public_html/second/files/ instead of /home/yourusername/public_html/second/public_html/
If you are wanting to create a new distinct website at inspuratesystems.com/second/ you don't need a second "public_html" folder. Just put them in the /home/yourusername/public_html/second directory.
If you are using a linux or OS X server, you may need to change the permissions on the folder.
Did you checked if the folder is hidden attribute?
If you execute ls -a in terminal, you will know about it's existence. If it is present then please try giving it read & execute permission (using chmod 555 command). Give write permission if you are planning to write something or take feedback from users (using chmod 777).
I tried some of this options above but unfortunately none worked. Instead I discovered that in CPanel you have a "Preferences" tab and in that tab you have a "User Manager" function. You can there edit the ftp user that you created before in CPanel. On the "User Manager" funcion you can find the "Home Directory" configuration. On that home directory you just choose the "public_html". When you configure the user in the ftp account on your ftp platform, it goes directly to the path you defined in CPanel.

Getting a 'Not Found' error on my website?

I'm trying to upload files to my domain that I'm hosting with Dreamhost. I connected to the server with FileZilla and I'm pretty sure I put the files in the right spot.
Their tutorial says to create a directory with your domain name like this: 'mydomain.com' and put your files in there. I put an index.html, p.css, register.php, login.php, and logout.php file in there. However, when I navigate to mydomain.com in Google Chrome, all I see is this:
Does anybody know what could be causing this?
BTW I didn't actually create a directory called "mydomain.com" I used the domain I own.
UPDATE:
The directories are set up like this:
/
mydomain.com
public_html
register.php
main.css
logout.php
login.php
index.html
Can you make sure you have group read permissions on the file you are attempting to fetch?
You want permission each file has a 755 permission, here is how you would change a file permission in FileZilla.
Also, make sure everything is in the public_html file.
public_html/index.html
public_html/p.css
public_html/register.php
public_html/login.php
public_html/logout.php
Try adding a file named .htaccess to your public_html directory. In this file, put the following line:
DirectoryIndex index.html
Assuming the webserver is Apache (or a work-alike) this tells the server to send index.html whenever someone asks for /.
I finally figured it out. For some reason it wasn't working when the directory was labeled mydomain.com. I changed it to mydomain_com and it fixed it for whatever reason. Thank you to cevaris and Amazed for helping me.

How To Direct Magento installation path in subfolder to main domain name

I have installed Magento 1.7.0.2 to mydomain.com/mag
(mydomain - is the primary registered domain at my hosting account)
(mag - is any subfolder)
As my website in testing mode, if anything goes wrong, i simply have to delete the “mag” folder and also it does not overwrite any files under public_html.
But if i install on directly to root directly public_html, then it may overwrite few files or folders and if i want to revert any time, then i cannot do that manually.
As i don’t even know the exact folder and file default structure under public_html prior to magento installation.
(I did that once by mistake, that happened)
Now at frontend the site URL will be mydomain.com/mag
But i want, if customers type the http://www.mydomain.com, they will be able to see the LIVE website instead of typing http://www.mydomain.com/mag
How do i do that
Also, will this be OK for SEO part.
Do we need to do this in Magento backend.
or
Do we need to do with hosting company by setting sub-domain type
or
By telling Simple scripts the installation to change the installation folder from mydomain.com/mag to www.mydomain.com
Please do suggest how can i do so.
Regards
In System > Config > Web you will find the following settings for your 'base url'. To update this you will have to perform the following 3 steps:
Step 1: Set the default store to the proper base url
Notice that the base url has the subfolder defined.
Step 2: Set your STORE VIEW base url to the root url
Using your dropdown on the left, change the "Current configuration scope" to your store view [NOT DEFAULT]
To change the base url value, uncheck 'use website' and enter your new base url:
Also, double-check in the same screen that your Session file management cookie path is set to the root folder of your site and that the domain is correct:
Step 3 [also used for multiple store management]
Finally, and this is important, you need to copy the index.php file, .htaccess file, and symlink your media,skin and js folders to your root directory, because they're only available to your subfolder Magento base install right now - we need to let your main domain know where to look for Magento!
From secure shell in your Magento installation directory (in your case, mag) as sudoer:
sudo cp index.php ../
sudo cp .htaccess ../
sudo ln -s js ../
sudo ln -s skin ../
sudo ln -s media ../
Your admin will still be available at yoursite.com/mag/admin.
Edit your index.php file in this main webroot (the file you just copied) and update it around line 45:
$mageFilename = 'app/Mage.php';
Change this to :
$mageFilename = 'cart/app/Mage.php';
Where 'mag' is the subfolder. In your case you'd use the folder named 'mag'. Finally, you need to clear the cache for these changes to take effect.
Step 4: Multi-store [optional]
If you have more than one store, they can all be served this way, but you need to edit the index.php file to give it the correct store code. More info about that can be found here:
http://www.magentocommerce.com/knowledge-base/entry/overview-how-multiple-websites-stores-work
i must say that figuring out how to symbolic link was a hassle and i still couldnt figure it out. All the other steps worked fine except i copied my htaccess and my index.php and i just pasted it to my root. So for those who are having trouble, i found a better solution instead of symbolic link for "media, skin and JS" folders. In your magento admin. System>config under general click web. just change your base skin, media and js to the folder you want them to point to...
ex: {{unsecure_base_url}}cart/skin/
worked for me. Hope it works for anyone with the same problem. Ohh and im using magento 1.8.1 Thanks again #philwinkle

Codeigniter not creating any log files

Under config.php I have:
$config['log_threshold'] = 4;
$config['log_path'] = '/home/myaccount/logFilesFolder';
In index.php I have:
error_reporting(E_ALL);
The only way I can seem to get anything to log is if I chmod that directory to rwx (777), which doesn't seem right to me. That and it doesn't see to be logging all the errors.
In my local/dev environment it seems to be working but on my production server nothing is being logged. I can't seem to figure out why.
The log filename in the configuration settings needs a trailing "/" above making sure the webserver process has writeable access to the directory.
Change the logs owner and group to what owner/group your live web server is running, give it write perms and it should work. I take it that in your local/dev server your CI folder is owned by you that is why you need to chmod it to 777 to make it work.
The directory where you want the log files to be saved needs to be writable.
I have tried a lot of solutions and finally what worked for me was this:
Open system/libraries/Log.php
and change the following lines;
set the value of: $this->log_path to a writable directory, preferably home directory so that there are no permission issues. If you want to change the filename also, search for the variable $filepath and change the name.
Example:
$this->log_path = '/log';
touch /log/
restart the webserver.
The logs will start coming.
I have tried a lot of other options, none worked, this is not neat approach but at least I can see my logs now.
I had the same problem with my Codeigniter 4 project. The log was created successfully in my local window machine but was not creating on the remote Linux machine. I was using a custom path to generate log files under the 'app' folder. So what I did is to change the settings in my config/Logger.php file back to
'path' => WRITEPATH.'logs/',
and it created the log files under writeable/logs folder.

Resources