Jump to content
php.lv forumi

Session


wolf3d

Recommended Posts

Labdien!

Nevaru nekādi tikt skaidrībā ar Session setingiem :(

Pārbaudīju ar phpinfo(), ka Configure Command sadaļā ir rindiņa --enable-session.

session.save_path man arī ir. Kaut kas līdzīgs šim /var/www/htdocs/tmp

Pati php datne glabājas /var/www/htdocs/mySite

Kad palaižu šādu skriptu

 

<?php
session_start();  
if(isset($_SESSION['views']))
$_SESSION['views'] = $_SESSION['views']+ 1;
else
$_SESSION['views'] = 1;

echo "views = ". $_SESSION['views']; 
?>

 

Logā vnk parādās šāds teksts

 

Warning: session_start() [function.session-start]: open(/var/www/htdocs/tmp/sess_a1mq2ihngb26r02qn2asj5s472, O_RDWR) failed: No such file or directory (2) in /htdocs/mySite/test/ses.php on line 2

views = 1

Warning: Unknown: open(/var/www/htdocs/tmp/sess_a1mq2ihngb26r02qn2asj5s472, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

 

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/www/htdocs/tmp) in Unknown on line 0

 

tmp mapes permission setting man ir 0775

Edited by wolf3d
Link to comment
Share on other sites

Man jau izklausās pēc kļūdas teksta, ka tev vienkārši nav tādas direktorijas - /var/www/htdocs/tmp

Pamēģini php kodā uzrakstīt:

<?php file_put_contents("/var/www/htdocs/tmp/tests.txt", "testa fails"); ?>

Vai tur izveidosies tests.txt fails?

Link to comment
Share on other sites

Es skaidri zinu, ka tur ir tāda tmp mape ;)

Un to kodu palaizot rodas šāds Warnings

Warning: file_put_contents(/var/www/htdocs/tmp/tests.txt) [function.file-put-contents]: failed to open stream: No such file or directory in /htdocs/mySite/test/ses2.php on line 1

Un fails tests.txt protams neizveidojas :(

Edited by bubu
Lūdzu netaisīt bezjēdzīgas QUOTEs
Link to comment
Share on other sites

safe mode?

Nooot Safe Mode man ir

;

; Safe Mode

;

safe_mode = Off

 

Un to mapi es pats personiigi izveidoju :) Tikko apskatiijos, vinja tur tieshaam ir :@

 

Mani tas php apmierinaatu, ja vien Sesijas straadaatu :@

Edited by wolf3d
Link to comment
Share on other sites

Ja 100% direktorija eksistee, tad viennoziimiigi useris, zem kura skrien apacis (vai jebkursh cits web serveris), atrodas citaa grupaa (vai arii ar citu useri), nekaa ir iesetota temp direktorijai. Visbiezhaak shaados gadiijumos, ja direktoriju veido pats, useris un owneris ir root:root. Un ja taa, tad 775 noziimee, ka pilnas tiesiibas ir tikai ownerim un grupai, bet paareji rakstiit nevarees.

 

ls -lah /var/www/htdocs/tmp & vi /etc/httpd/httpd.conf will be your friend :)

Edited by max
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...