[Solved] Replacing PHP with newer version

#1
Hia, I just joined this forum because I'm a bit in a hooey with LiteSpeed.
So, uh... I have a 128MB VPS that I'm using as a small web server. I'm trying to update PHP, but the problem is, it doesn't want to compile because of the lack of memory!
So, I downloaded VMware Player on my computer, and compiled PHP on that, I have all the files now.

Now, how do I transfer all the settings and stuff to the small VPS? I've tried copying phpbuild to the server, and using ./configure, with no luck.

I also tried overwriting fcgi-bin and copied lsphp5 to the server. Again, no luck.

Is it possible to replace PHP with the already compiled binaries?

Thanks,
r4ym0nf.
 

NiteWave

Administrator
#2
yes. copy over the binary and its dependent libraries , it will work.

use ldd to locate the dependencies. an example FYI:
/usr/local/lsws/fcgi-bin>ldd lsphp-5.3.23
linux-gate.so.1 => (0x00b2d000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00410000)
libresolv.so.2 => /lib/libresolv.so.2 (0x008be000)
librt.so.1 => /lib/librt.so.1 (0x0062c000)
libm.so.6 => /lib/libm.so.6 (0x005d0000)
libdl.so.2 => /lib/libdl.so.2 (0x005c9000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00699000)
libc.so.6 => /lib/libc.so.6 (0x0046e000)
libpthread.so.0 => /lib/libpthread.so.0 (0x005fb000)
/lib/ld-linux.so.2 (0x0044f000)
 
#3
yes. copy over the binary and its dependent libraries , it will work.

use ldd to locate the dependencies. an example FYI:
/usr/local/lsws/fcgi-bin>ldd lsphp-5.3.23
linux-gate.so.1 => (0x00b2d000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00410000)
libresolv.so.2 => /lib/libresolv.so.2 (0x008be000)
librt.so.1 => /lib/librt.so.1 (0x0062c000)
libm.so.6 => /lib/libm.so.6 (0x005d0000)
libdl.so.2 => /lib/libdl.so.2 (0x005c9000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00699000)
libc.so.6 => /lib/libc.so.6 (0x0046e000)
libpthread.so.0 => /lib/libpthread.so.0 (0x005fb000)
/lib/ld-linux.so.2 (0x0044f000)

Sorry, I forgot to say that I'm a Linux nub (I derived that from Linux nut, as my teacher calls me :S), so I have no idea where:
linux-gate.so.1 => (0x00b2d000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x00410000)
libresolv.so.2 => /lib/libresolv.so.2 (0x008be000)
librt.so.1 => /lib/librt.so.1 (0x0062c000)
libm.so.6 => /lib/libm.so.6 (0x005d0000)
libdl.so.2 => /lib/libdl.so.2 (0x005c9000)
libnsl.so.1 => /lib/libnsl.so.1 (0x00699000)
libc.so.6 => /lib/libc.so.6 (0x0046e000)
libpthread.so.0 => /lib/libpthread.so.0 (0x005fb000)
/lib/ld-linux.so.2 (0x0044f000)
is. Sorry. ;_;
Could you please explain where they are?

The 2 systems are both Debian 6.

Thanks,
r4ym0nf.
 

NiteWave

Administrator
#4
just explain 1 line:
libresolv.so.2 => /lib/libresolv.so.2 (0x008be000)
this means lsphp-5.3.23 need /lib/libresolv.so.2

check your 128MB VPS, if /lib/libresolv.so.2 exist, if not, copy this file from VMware Player, with same location.
 

NiteWave

Administrator
#6
it should work, just like you compile php from the VPS.
any error message when you run at command line:
#/usr/local/lsws/fcgi-bin/lsphp5 -i
 
#7
it should work, just like you compile php from the VPS.
any error message when you run at command line:
#/usr/local/lsws/fcgi-bin/lsphp5 -i
Ah, I see. When I load the server up with WinSCP, it has that little red shortcut mark, so I'll go see what went wrong on VMware.
 
#8
Ah, I see. When I load the server up with WinSCP, it has that little red shortcut mark, so I'll go see what went wrong on VMware.
Okay, so that worked for a little while, then I noticed it wasn't loading php.ini since the VPS had LS installed at /ls/, where the VM had the default path.

So, I reinstalled the VPS to have the same location, but now I'm getting 503 errors when I try to use phpinfo();.

So, I then tried to remove lsphp4 from External Applications because I thought it was the culprit. Nope.

Code:
[#Example] connection to [/tmp/lshttpd/lsphp5.sock] on request #0, confirmed, 0, associated process: -1, running: 0, error: Connection reset by peer!
2013-04-07 22:08:20.525
NOTICE	[#Example] Max retries has been reached, 503!
2013-04-07 22:08:20.525
NOTICE	[#Example] oops! 503 Service Unavailable
2013-04-07 22:08:20.525
NOTICE	[#Example] Content len: 0, Request line: 'GET /phpinfo.php HTTP/1.1'
Is it a memory problem?
 

webizen

Well-Known Member
#9
very likely because you only have 128MB. check memory_limit in php.ini and memory limit (soft/hard) in LSWS (Admin Console => Configuration => Server => External App => lsphp5). make sure memory_limit in php.ini < (less than) memory_limt (soft/hard) in LSWS < 128MB.
 
#10
very likely because you only have 128MB. check memory_limit in php.ini and memory limit (soft/hard) in LSWS (Admin Console => Configuration => Server => External App => lsphp5). make sure memory_limit in php.ini < (less than) memory_limt (soft/hard) in LSWS < 128MB.
I set it to 3(s)2-60(h)MB, still the same error. :S
 
#11
Yes! It works now.
I have decided it's Debian. I installed Ubuntu and for some reason, with the same steps as I did with Debian, it just works. It magically works.
Now, the only problem is MySQL, which I should get working with 10.04.

Thanks for all the help!
 
Top