I have an Apache server running on RHEL 6.5. For the past few days I have been trying to install OSticket, an open source ticket system, and keep getting this error when trying to access the setup directory with my browser.
Warning: session_start() [function.session-start]: open_basedir
restriction in effect. File(/tmp) is not within the allowed path(s):
(/u00/apache_homes/sdm/:.:/u00/app/php/lib/php/) in
/u00/apache_homes/sdm/htdocs/support/setup/setup.inc.php on line 53
Fatal error: session_start() [function.session-start]: Failed to
initialize storage module: files (path: ) in
/u00/apache_homes/sdm/htdocs/support/setup/setup.inc.php on line 53
Now I know the issue is that the page dose not have permission to access the /tmp directory. I cannot give it access for security reasons according to the server admin. We do have another tmp directory set up under the Apache folder.
My question is this. Is it possible to specify a override to use this new directory globally as the tmp directory? Is it upload_tmp_dir in the php.ini what I am looking for?
Related
when I try to run a especifical project on my computer, symfony show me this error:
Warning: SessionHandler::read(): open(/opt/alt/php74/var/lib/php/session\sess_rt7p5374uhjagiperqv83aej38, O_RDWR) failed: No such file or directory (2)
I'm use symfony 5.4 and PHP 8
I found this line session.save_path = "/opt/alt/php74/var/lib/php/session"
in .user.ini file and I changed it and now it's working
There is nothing wrong with Symfony's side. You can set proper path at session.save_path in your php.ini
session.save_path = "/path/to/your/folder"
The folder you use should be under your domain/account but not accessible through a Web browser. It also needs to have world-writable permissions on it based on user/role.
I am new to laravel and I run my website on localhost. It runs correctly but when I upload it on cpanel, it raises these errors :
Warning:
require(/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in
/home/didfilei/public_html/app/vendor/composer/autoload_real.php on
line 66
Warning:
require(/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: No such file or directory in
/home/didfilei/public_html/app/vendor/composer/autoload_real.php on
line 66
Fatal error: require(): Failed opening required
'/home/didfilei/public_html/app/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php'
(include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in
/home/didfilei/public_html/app/vendor/composer/autoload_real.php on
line 66
I solved it. I realized that after extracting the zip file with cpanel, some folders were deleted (eg '/ symfony'), so I got more space from the hosts, then my project extract correctly
Since you do not have access to SSH, you should upload the vendor files along with the rest of your project.
Be careful that if your dev machine is windows, you might face some issues with paths and case sensitivity.
You also need to check how php is executed in your host. You might have to fiddle around with file ownership and access rights.
Especially if suphp is used, your user must be the owner of everything in your folder, all files must be set to 644 and all folders to 755
SSH into your server and run composer update in the root of your project. This will pull in the required vendor files that you are missing.
Been trying to install php today and I ran into this problem when trying to launch my website:
PHP Warning: session_start(): open_basedir restriction in effect. File(C:\Windows\TEMP) is not within the allowed path(s): (C:\Users\Administrator\Desktop\website) in C:\Users\Administrator\Desktop\website\bootstrap.php on line 21
I have set my php.ini to the following settings:
open_basedir = "C:\Users\Administrator\Desktop\website\"
and
upload_tmp_dir = "C:\Windows\TEMP\"
I tried changing the directory for upload_temp_dir to C:\Users\Administrator\Desktop\website\temp but the error keeps telling me that C:\Windows\TEMP is not valid - even though I changed the dir.
Any ideas?
Thanks.
EDIT:
Now I am getting:
PHP Warning: session_start(): open(C:\Windows\TEMP\\sess_ca0ea257d89dfecd355e375071e30d7e, O_RDWR) failed: Permission denied (13) in C:\Users\Administrator\Desktop\website\bootstrap.php on line 21
PHP Warning: Unknown: open(C:\Windows\TEMP\sess_ca0ea257d89dfecd355e375071e30d7e, O_RDWR) failed: Permission denied (13) in Unknown on line 0
PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\Windows\TEMP) in Unknown on line 0
open_basedir limits the files that can be opened by PHP within a directory-tree.
You should config session.save-path to some path inside
C:\Users\Administrator\Desktop\website\
Or add the session directory to the list of folders that PHP script can access
session.save-path = "C:\Windows\TEMP\"
open_basedir = "C:\Users\Administrator\Desktop\website\;C:\Windows\TEMP\"
NOTE: I had to remove the quotes from the open_basedir path on Windows 10, PHP 7.3 (in the php.ini file)
Does not work: open_basedir = "C:\Windows\TEMP\;C:\Some\Other\Path\"
Works open_basedir = C:\Windows\TEMP\;C:\Some\Other\Path\
I have a vps with centOS LAMP stack, and multiple domains/ips. A long time ago I had someone more familiar with SSH install pear on the vps, and I believe he configured it for a specific user/domain, which no longer exists, and now pear is throwing errors.
The old user/domain which no longer exists is "ljsspin" but when I look at my php.ini, the include path is:
include_path = ".:/usr/share/pear/:/usr/share/php:/var/www/ljsspin/data/pear/:"
I can execute pear commands in ssh, but I'm assuming the fact that the last portion of that include path no longer exists is the reason for the error.
So my question is how do I install the necessary /data/pear files into a new directory? I've tried upgrading pear, and that, too, produced an error (unable to unpackage a structure file).
Thanks for any guidance.
Exact error message I receive:
Warning: include() [function.include]: open_basedir restriction in effect. File(/usr/share/pear/Mail.php) is not within the allowed path(s): (/var/www/steve/data:.) in /var/www/steve/data/www/newdomain.com/admin/dashboard/includes/pdf.php on line 3
Warning: include(/usr/share/pear/Mail.php) [function.include]: failed to open stream: Operation not permitted in /var/www/steve/data/www/newdomain.com/admin/dashboard/includes/pdf.php on line 3
Warning: include() [function.include]: Failed opening 'Mail.php' for inclusion (include_path='.:/usr/share/pear/:/usr/share/php:/var/www/ljsspin/data/pear/:') in /var/www/steve/data/www/newdomain.com/admin/dashboard/includes/pdf.php on line 3
The open_basedir restriction in effect error message means that you've set a value for the open_basedir PHP directive so scripts are not allowed to read files from outside a given set of directories, which in your case are these:
/var/www/steve/data
.
Since PEAR packages are installed in some other directory:
/usr/share/pear/
... PHP prevents scripts from reading them, as it's been instructed to do.
If you intend to allow access to /usr/share/pear/, you'll obviously have to broaden the restriction.
I can't install WordPress Importer 0.5 on Boldy theme.
the message i get when installing the plugin is this:
Warning: touch() [function.touch]: SAFE MODE Restriction in effect. The script whose uid is 10736 is not allowed to access /tmp owned by uid 0 in /var/www/vhosts/griffedecorazioni.it/httpdocs/wp-admin/includes/file.php on line 177
Warning: unlink() [function.unlink]: SAFE MODE Restriction in effect. The script whose uid is 10736 is not allowed to access /tmp owned by uid 0 in /var/www/vhosts/griffedecorazioni.it/httpdocs/wp-admin/includes/file.php on line 489
Download failed. Destination directory for file streaming does not exist or is not writable.
............
Try setting the constant WP_TEMP_DIR which should change the directory downloaded packages are saved to. Put something like this in your wp_config.php:
define('WP_TEMP_DIR', ABSPATH . 'wp-content/');