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.
Related
I was getting this error upon starting phpmyadmin on macOS High Sierra:
session_start(): open(SESSION_FILE, O_RDWR) failed: Permission denied (13)
Later I found out that the session.save_path was set to "/Applications/XAMPP/xamppfiles/temp" but the phpinfo() displayed:
session.save_path no value no value
I tested it by changing the path to another directory but it did not work and I am still getting the same 'no value'.
As a result I am unable to use session functions in any project.
You cat set session save path before running session start function, in you php application, for example:
ini_set('session.save_path','/var/tmp/');
OR
session_save_path('/var/tmp/');
OR in php.ini file:
session.save_path = "/var/tmp/"
I trying to installing ratchet using composer I installed composer using the insteller.exe but my problem is when I run this line on CMD I get this error
C:\1>php "C:/programData/ComposerSetup/bin/composer.phar" require cboden/ratchet
[ErrorException]
fopen(C:\Users\shako\AppData\Local\Temp;C:\xampp\mysql\bin;C:\xampp\php;/co
mposer-cacert-300c74d6960d46715ffed607c8e36acfa7cbcad49862bb1b67d3c43dea9bf
b40.pem): failed to open stream: No such file or directory
I tryed to fix this error by changing this line from php.ini file
from
sys_temp_dir = "/tmp"
to
sys_temp_dir = C:\Users\shako\AppData\Local\Temp;C:\xampp\mysql\bin;C:\xampp\php\php.exe
but I still get the same error
I tried to comment sys_temp_dir but it didn't work for me.
I resolved the issue by creating a folder for temporary files outside the application folder, a location which the users don't have access to. Then I defined that folder to sys_temp_dir. As an example:
sys_temp_dir = C:\inetpub\temp\files
Good luck!
Comment this line
sys_temp_dir
in your php.ini
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?
When I migrated magento store and run it locally this happens.
Failed to initialize storage module: user (path: C:\wamp\www\magento\var\session) in C:\wamp\www\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php on line 115
This is line 115: session_start();
Help please.
For future reference, core_session table is missing in the database.
Look into your php.ini and make sure that the save_path isn't commented or missing:
session.save_path = "C:\wamp\tmp"
Create the folder C:\wamp\tmp first, change php.ini, then restart wamp.
I am getting the following warning and error on a plesk server where I am trying to get the Zend framework working:
PHP Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/mydomain.com/httpdocs/test.php on line 5
PHP Fatal error: require_once() [function.require-once]: Failed opening required 'Zend/Loader.php' (include_path='.:/usr/share/pear:/local/PEAR/:/usr/share/zend') in /var/www/vhosts/mydomain.com/httpdocs/test.php on line 5
I have set the include_path in the php.ini file (/etc/php.ini) to use the directory where I have added the Zend files (/usr/share/zend). This directory then has the framework in a sub-dir called Zend.
I have tried adding a slash to the end of the include_path (/usr/share/zend/).
The path is present when I use get_include_path()
I have tried using set_include_path.
The /usr/share/zend directory has 775 permissions (also tried with 777) and the user and group are both set to root.
I would like to have the framework available to all sites on the server.
I have copied in the Gdata files too and the Zend/Loader.php is there.
Versions:
Framework: 2.0.4
Gdata: 1.12.0
This is the PHP:
require_once("Zend/Loader.php");
I have also tried using:
require_once("/usr/share/zend/Zend/Loader.php");
I am novice plesk/unix user
The things to check for are:
The file exists where PHP is looking for it.
The file is readable by the web server/php_fpm process.
safe_mode is off!
(Putting the information here - so that the question can be marked as answered!)
Zend/Loader.php is for ZF1 and that file don't exists with ZF2 (2.0.4)
Also you need to download the updated version of GData compatible with ZF2
https://github.com/zendframework/ZendGData
If you'll use Composer to setup your dependencies then you should use require_once __DIR__ . '/path/to/vendor/autoload.php