Issue with ExpressionEngine caching file permissions - caching

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.

Related

Laravel lock some folders on host

Guys I have created my first Laravel Project and I uploaded it to the server successfully and everything works perfect.
But I can write in the url www.mydomain.com/resources/views and show all my views!
Also user can open my .env file and view my database connection info!
I want only the user to navigate only to my routes not to any folder he guess.
Basic Instruction to Deploy Laravel to shared hosting7
You should point your document root to app/public/
run composer install in the project root directory
set writable permissions to bootstrap cache chmod 777 bootstrap/cache
set writable permissions to storage chmod 777 storage -R
There are many things that can go wrong while deploying application. So, it would be easier for us to help you, if you also provide us step by step process that you followed while deploying the laravel application.
For securing your routes and .env file you need to get into your hosting root directory, create .htaccess file and copy the below code and paste it in there
# Disable index view
Options -Indexes
<FilesMatch "\.env$">
Deny from all
</FilesMatch>
I hope this will solve your problem.

local php.ini sessions.save_path issue - sessions not recognised

I have a client who is running a user management script. The host provider had blocked allow_url_fopen but is using suPHP so we created a local copy of php.ini with allow_url_fopen set to "on".
The only problem now is that you can no longer login to using the script - it says 'success logging you in' - then logs you right out (because the sessions are either not getting created or are in the wrong place - excuse my lack server knowledge).
Here are the settings in the local php.ini
upload_tmp_dir = "/home/aspac124/public_html/tmp"
register_globals = On
memory_limit = 256M
session.save_path = "/home/aspac124/public_html/tmp"
safe_mode = off
upload_max_filesize = 32M
allow_url_fopen = On
zend_extension = "/usr/local/IonCube/ioncube_loader_lin_5.3.so"
I'm not sure why the hosting provider turned register_globals on for the client. But is that the correct place for the session.save_path? I've checked and the folder exists and I also set it to 777 just to make sure but no happiness.
Another client using the same system had a similar issue and told me he changed the tmp/ folder to his home directory and everything was fine.
I've tried to put the save path as just /tmp, /home/aspac124/tmp and nothing happens - just get logged out as normal. If I make up a path then I get a "No such file or directory" error.
When I put it as "/home/tmp" I get the following message
Warning: session_start() [function.session-start]: open(/home/tmp/sess_4417d180e599b5f12fc34a28f5467d21, O_RDWR) failed: Permission denied (13) in /home/aspac124/public_html/domainnamehere.com/includes/lightwork_session.php on line 45
What does this mean, is the home/tmp the correct place for this and if so what should I do - should the folder permissions be changed?
edit: I don't have access to folders outside the domain root so cannot change the file permissions - have to wait for the client but would like as much info before then.
Thanks in advance
EDIT: Just for anyone reading this. Please make sure your local php.ini file settings are applied to any sub folder that may require it. I was making ajax requests to a file in a sub folder to the root and this was the issue.
You should place your session and upload directories outside of the document root otherwise these will be accessible by anyone and can result in remote script injection, session hijacking etc.
You should perhaps create a tmp directory as /home/aspac124/tmp and set the permissions so Apache can write to this directory. Perhaps set the chmod to 0760.

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

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';

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.

Which folders and files needed 777 mode in joomla 1.5?

After joomla upload to ftp . how many folder needed mode 777 need enable to working joomla without any error.
Depending on the security configuration of your Web server the recommended default permissions of 755 for directories and 644 for files should be reasonably secure.
source: http://docs.joomla.org/What_are_the_recommended_file_and_directory_permissions%3F
Only bad hosting providers will require you to set permissions to 777. If you have to do that, or are told to do that by your host, save yourself and get a better host. I don't deal with clients on hosts like that, because its the source of a LOT of security issues.
never use 777 but use 755.
755 only for writeable folders like components, modules, templates, caches and images.
except for that .. set to 664
None.
Joomla 1.5 contains an option that uses your FTP account and password to write to files it needs to write to. Enable that and none of them need to be world writeable.
You can check which folders to chmod in system check of your joomla admin
The only file that needs to be writable is configuration.php. It should be set to 666.
You can find the list of folders by going to the Joomla admin area (the 'administrator' folder in your Joomla installation). Go to Help > System info in the menu then click Directory permissions. This page tells you whether they are writable or not. Folders should be set to 777.
To solve installation errors I have found setting the following directories to 777 to be very convenient BUT EXTREMELY UNSAFE.
/administrator/backups/
/administrator/components/
/administrator/language/
/administrator/language/en-GB/
/administrator/language/nl-NL/
/administrator/modules/
/administrator/templates/
/components/
/images/
/images/banners/
/images/stories/
/language/
/language/en-GB/
/language/nl-NL/ or other lang
/language/pdf_fonts/
/modules/
/plugins/
/plugins/content/
/plugins/editors/
/plugins/editors-xtd/
/plugins/search/
/plugins/system/
/plugins/user/
/plugins/xmlrpc/
/tmp/
/templates/
/cache/

Resources