-1

I am using Debian jessie

I installed apache 2.4 and php 7.0 but the problem that I have is that the variables are always while I put the instruction session_start () in all the pages Thank you for help me please

Assane Keita
  • 11
  • 1
  • 3

1 Answers1

0

I'm no php guru but I think you could try to save the session vars into a static variable, and then check the output of that var to see if it's empty or not. There are probably ways of debugging php scripts and see what's wrong but I can't help you with that.

If I were you I would also check the permissions for /var/lib/php/session. That folder is used to save temporary session vars used/generated by php. If let's say your apache is running as nobody or www-data or apache, set the proper ownership for that folder according to your apache user.

ps aufx | grep httpd

First entry on the left would be the user. Remember that user and issue a:

chown apacheuser:apacheuser /var/lib/php/session

Restart apache (systemctl restart httpd) and try again and see if that works!

Bogdan Stoica
  • 4,349
  • 2
  • 23
  • 38
  • Hi To make sure of the tests I create two files index.php and index2.php Where I initialize a first variable in the first and that indexed in the second page but it did not work. For the / var / lib / php / session folder does not exist Cd / var / lib / php / session -bash: cd: / var / lib / php / session: No such file or directory – Assane Keita Aug 16 '17 at 16:20
  • Are you sure you have installed php correctly?! Do you have a `php.conf` file in `/etc/httpd/conf.d` ? – Bogdan Stoica Aug 16 '17 at 16:58