Can't start SA-MP Server by PHP
#1

Hi everyone,

Today i tried to start my SA-MP Server as version 0.3d in Linux by PHP but i couldnt. In 0.3c i was using:

popen("cd /home/sampsvr && ./samp03svr &", "r");

Now i used the same script but nothing happens...

Can someone help me please?

PD: It works perfectly by SSH, but not with exec, system, popen, etc.
Reply
#2

Install ssh2.so module for PHP, and then start it by using ssh2_exec().
****** on how to install it.
Reply
#3

If you are running centOS , please do the next commands(skip that you have already done)

wget -q -O - http://www.atomicorp.com/installers/atomic | sh
yum upgrade
yum install vsftpd php php-devel openssl-devel php-pear
mkdir libssh2
cd libssh2
yum install gcc
wget http://www.libssh2.org/download/libssh2-1.3.0.tar.gz
tar xvzf libssh2-1.3.0.tar.gz
cd libssh2-1.3.0
./configure
make install
pecl install ssh2 (will give you a error, after that write pecl install ssh2 [channel://.....])
after that vi /etc/php.ini
add on the file(somewhere)
extension=ssh2.so
after that save the file
and restart your webserver
service httpd restart
^^apache web server

and try your commands again.
Reply
#4

I already fixed a few errors on ./configure, but i cant with this one:
configure: error: cannot find OpenSSL or Libgcrypt, try --with-libssl-prefix=PATH or --with-libgcrypt-prefix=PATH

Yes, i have OpenSSL and Libgcrypt installed, and i tried too with ./configure --with-libssl-prefix=/usr/bin/openssl

EDIT: Fixed by installing openssl-devel
Reply
#5

well after installed try again to start your server.
Reply
#6

No, it doesnt starts...
Reply
#7

Add me on msn: papapanikes@hotmail.com
I will help you via msn ok?
Reply
#8

Well, tried with ssh2 like this:

$connection = ssh2_connect("localhost", 22);
ssh2_auth_password($connection, "root", "123456");
ssh2_exec($connection, "cd /home/samp03 && ./samp03svr");

It doesn't start... If i put exactly that command "cd /home/samp03 && ./samp03svr" on Putty it works fine.
Help please, im using CentOS 5.7.
Reply
#9

Solved, installed Debian ^^.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)