Nexus windows Problems

Source: Internet
Author: User
Tags zts

The source code of the relatively successful Pt (Private tracker) in China has many users, working with cgbt, and is now open-source!

The latest nexusphp 1.5 Beta 4 Version opens all source code according to the GPL Protocol

Nexusphp Official Website: http://www.nexusphp.com

: Http://sourceforge.net/projects/nexusphp/

Author's original blog: http://hi.baidu.com/xiazuojie

The installation method is provided in the installation package. Memcache is required. You can directly build memcache using ampserv (select memcache)

Common Errors:
Warning: memcache: connect () [memcache. Connect]: Can't connect
Localhost: 11211. Because the connection provider fails to respond correctly after a period of time or the connected host does not respond,
Connection attempt failed. (10060) in D:/apmserv5.2.6
/Www/htdocs/classes/class_cache.php on line 19

Solution:
Enter the classes/class_cache.php file.
Function _ construct ($ host = 'localhost', $ Port = 11211 ){
Change localhost to 127.0.0.1.

Common Errors:

Fatal Error: Class 'memcache' not found inD:/classes/class_cache.phpOn Line
4

Solution:

The development and debugging environment of memcache Is Not Installed

Many phper do not know how to set up a memcache development and debugging environment in windows. Recently, I am also studying memcache and recording the process of self-installation.
In fact, when I started to study memcache, I didn't know that there was a memcached for Win32 bird thing, which caused me to be able to handle it in a one-day way in the case of Cen-tos, today, I suddenly found that there is no problem in developing and debugging memcache in windows, so I wrote a memcache document to share with you.

Install memcache in Windows:
1. Download the stable version of memcache for Windows and decompress it to a disk, for example, in C:/memcached
2. Enter 'C:/memcached/memcached.exe-D install' on the terminal (that is, the CMD command interface) to install
3. Enter 'C:/memcached/memcached.exe-D start' to start. Note: in the future, memcached will be used as a Windows Service and will be automatically started every time it is started. In this way, the server has been installed.
4. Download php_memcache.dll. Find the corresponding PHP version file by yourself.
5. Add a line 'extension = php_memcache.dll 'to C:/winnt/PHP. ini'
6. Restart Apache and check phpinfo. If memcache exists, the installation is successful!

Basic settings of memcached:

-P listening port
-L connected IP address. The default value is local
-D start: Start the memcached service.
-D restart: restart the memcached service.
-D stop | Shutdown the running memcached Service
-D install the memcached Service
-D uninstall memcached Service
-U runs as the identity (only valid when running as root)
-MB maximum memory usage, in MB. The default value is 64 MB.
-An error is returned when M memory is used up, instead of deleting items.
-C: Maximum number of simultaneous connections. The default value is 1024.
-F block size growth factor, default value: 1.25
-N: minimum allocation space. The default value of key + value + flags is 48.
-H Show Help

Test the memcache Environment:
Run the following PHP file. If this is a test! Is output !, Indicates that the environment is successfully set up. Start to appreciate the charm of memcache!
<? PHP
$ Mem = new memcache;
$ Mem-> connect ("127.0.0.1", 11211 );
$ Mem-> set ('key', 'This is a test! ', 0, 60 );
$ Val = $ mem-> get ('key ');
Echo $ val;
?>

Install the memcache server in Linux
The server is mainly installed on the memcache server, the latest version is memcached-1.3.0.
Download: http://www.danga.com/memcached/dist/memcached-1.2.2.tar.gz
In addition, memcache uses the libevent library for socket processing, so you also need to install libevent, the latest version of libevent is the libevent-1.3. (If your system has already installed libevent, you do not need to install it)
Official Website: http://www.monkey.org /~ Provos/libevent/
Download: http://www.monkey.org /~ Provos/libevent-1.3.tar.gz

Use the wget command to directly download these two items.
1. Install libevent first. During configuration, You need to specify an installation path, that is,./configure-Prefix =/usr; then make install;
2. Install memcached again. You only need to specify the installation path of libevent during configuration, that is,./configure-with-libevent =/usr; then make install;
This completes the installation of the memcache server in Linux. The detailed method is as follows:

1. Download memcached and libevent respectively and put them in the/tmp directory:
# Cd/tmp
# Wget

Http://www.danga.com/memcached/dist/memcached-1.2.0.tar.gz

# Wget

Http://www.monkey.org /~ Provos/libevent-1.2.tar.gz

2. Install libevent first:
# Tar zxvf libevent-1.2.tar.gz
# Cd libevent-1.2
#./Configure-Prefix =/usr
# Make
# Make install

3. test whether the libevent is successfully installed:
# Ls-Al/usr/lib | grep libevent
Lrwxrwxrwx 1 Root 21 11 ?? Libevent-1.2.so.1> libevent-1.2.so.1.0.3
-Rwxr-XR-x 1 Root 263546 11 ?? Libevent-1.2.so.1.0.3
-RW-r-1 Root 454156 11 ?? 12 libevent.
-Rwxr-XR-x 1 Root 811 11 ?? Libevent. La
Lrwxrwxrwx 1 Root 21 11 ?? 12 libevent. So-> libevent-1.2.so.1.0.3
Not bad. They all have been installed.

4. Install memcached and specify the libevent installation location during installation:
# Cd/tmp
# Tar zxvf memcached-1.2.0.tar.gz
# Cd memcached-1.2.0
#./Configure-with-libevent =/usr
# Make
# Make install
If an error is reported in the middle, check the error information carefully and configure or add the corresponding library or path according to the error information.
After the installation is complete, the memcached will be placed in/usr/local/bin/memcached,

5. Test whether memcached is successfully installed:
# Ls-Al/usr/local/bin/MEM *
-Rwxr-XR-x 1 Root 137986 11 ?? 12 :39/usr/local/bin/memcached
-Rwxr-XR-x 1 Root 140179 11 ?? 12 :39/usr/local/bin/memcached-Debug

Install the PHP extension of memcache
1. Select the desired memcache version in the http://pecl.php.net/package/memcache.
2. Install memcache extension for PHP

Tar vxzf memcache-2.2.1.tgz
CD memcache-2.2.1
/Usr/local/PHP/bin/phpize
./Configure-enable-memcache-with-PHP-Config =/usr/local/PHP/bin/PHP-config-with-zlib-Dir
Make
Make install

3. A message similar to this will appear after the above installation:

Installing shared extensions:/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-2007xxxx/

4. Modify extension_dir = "./" in PHP. ini

Extension_dir = "/usr/local/PHP/lib/PHP/extensions/no-debug-non-zts-2007xxxx /"

5. Add a row to load the memcache Extension: Extension = memcache. So

Basic settings of memcached:
1. Start the memcache Server:
#/Usr/local/bin/memcached-D-M 10-u root-l 192.168.0.200-P 12000-C 256-P/tmp/memcached. PID

-D option is to start a daemon,
-M indicates the amount of memory allocated to memcache. The unit is mb. Here I am 10 MB,
-U is the user who runs memcache. Here I am root,
-L is the IP address of the listening server. If there are multiple IP addresses, I have specified the IP address 192.168.0.200,
-P is the port for memcache listening. I have set port 12000 here, preferably port 1024 or above,
-The "C" option is the maximum number of concurrent connections. The default value is 1024. I have set 256 here, which is based on the load of your server,
-P is the PID file for saving memcache. Here I save it in/tmp/memcached. PID,

2. to end the memcache process, run:

# Kill 'cat/tmp/memcached. Pi'

You can also start multiple daemon processes, but the ports cannot be repeated.

3. Restart Apache and service httpd restart

Test the memcache Environment:
Run the following PHP file. If this is a test! Is output !, Indicates that the environment is successfully set up. Start to appreciate the charm of memcache!
<? PHP
$ Mem = new memcache;
$ Mem-> connect ("127.0.0.1", 11211 );
$ Mem-> set ('key', 'This is a test! ', 0, 60 );
$ Val = $ mem-> get ('key ');
Echo $ val;
?>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.