Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

/var/lib/php/session

If you are running any PHP application that requires writing of session files in the server but it fails like in the Apache log below:


[Thu Oct 27 09:41:02 2011] [error] [client 171.4.87.27] PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in

Please check whether you have this directory in place, create it if it hasn't there.
Change the permission to 777, and try run it again.

If you were able to see session files being written, then you are good.
Now make sure the file permission for those session files in this directory was not readable and writable by other users.

[root@server apache2]# ll  /var/lib/php/session/
total 4
-rw------- 1 userb userb 40 Oct 27 09:39 sess_3bsrvlkc291l7jlsakvtknv3v0
-rw------- 1 usera usera  30 Oct 27 09:39 sess_3s95nd55qs44s0uslsai2ghlu7



XCache 1.3 Installation Problem

XCache 1.3 Installation Problem

When try to install 1.3, I get this error:
# phpize
# ./configure
# make
=====================================================
In file included from /usr/include/php/ext/date/lib/timelib.h:24,
from /usr/include/php/ext/date/php_date.h:24,
from /root/server/xcache-1.3.0/xcache.c:26:
/usr/include/php/ext/date/lib/timelib_structs.h:24:28: error:
timelib_config.h: No such file or directory
/root/server/xcache-1.3.0/xcache.c:2959: warning: initialization
discards qualifiers from pointer target type
make: *** [xcache.lo] Error 1
}}}
=====================================================

It is because it have problem searching .h file within the same directory.

Solution :
Note : Compiler assumed as gcc.

- open /usr/include/php/ext/date/lib/timelib_structs.h
# vi /usr/include/php/ext/date/lib/timelib_structs.h

- Change following :
#include  

To

#include “timelib_config.h” (or vice versa)

OR

#include “/usr/include/php/ext/date/lib/timelib_config.h”

Save and exit from file.

and now try to run “make” again. It will install without any problem.

PHP 5.2.1 installation error

PHP 5.2.1 installation error

After you have installed your Apache2, and you want to compile PHP5.2.1 into it, and during the ./configure you face problem as below:

Problem:

checking for IMAP Kerberos support... no
checking for IMAP SSL support... yes
checking for utf8_mime2text signature... new
checking for U8T_CANONICAL... no
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.


Resolution

This can be solve by just installing the libc-client.i386 and libc-client-devel.i386

yum install
libc-client.i386 libc-client-devel.i386


Then try to recompile your php again, this shall work.

ffmpeg installation

if you get error below while running "ffmpeg" command,


###
error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory