PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to store object information in session in file1.php and then make file2.php get that session information. When I use session_start() call I get the following errors:
Warning: session_start() [function.session-start]: open(/root/tmp/sess_f38d1b1f591c8126c53090d3ddea0f5a, O_RDWR) failed: Permission denied (13) in /var/www/html/test/doVacationsSearch_test.php on line 4
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /var/www/html/test/doVacationsSearch_test.php:4) in /var/www/html/test/doVacationsSearch_test.php on line 4
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/html/test/doVacationsSearch_test.php:4) in /var/www/html/test/doVacationsSearch_test.php on line 4
Could somebody please tell me what is going wrong here or how I can fix this?
php by default stores session data in files. The account running the php script does not have permissions to access these files.
The config parameter session.save_path sets the directory where these files are located, currently /root/tmp/ /root/tmp ?
Yes, I think I fixed by making everything executable (I think) in tmp with this command:
chmod -R +x /root/tmp
which I guess set everything to highest permissions possible. But I have other problems now on how to register an object in a session and have file2.php obtain that object.
Thank you so much for clarification. I have been doing this approach but every time I put require 'foo.php' (it's not a class just a PHP file that calls SOAP API methods) I get these methods being called when I launch file2.php but with parameters intended to be passed into file2.php, very strange. Does this mean that foo.php *must* be a class? I get the sense that if it is a class then foo.php's methods would be called only when invoked. But I'm new to PHP so I'd rather get some knowledgeable comments before I start converting foo.php into a standalone class.