Memcached Experiment (ii) PHP program call

Source: Internet
Author: User
Tags install php

Vi/etc/php.ini

Add a row

Extension=memcache.so

Join self-starter

Systemctl Enable memcached

Yum Install PHP

[Email protected] ~]# systemctl start httpd

[Email protected] ~]# Systemctl httpd enable

Start, and then join Auto-start

Access under virtual machine, already Apache up

http://192.168.209.147/


/var/www/html directory put a info.php and test.php to test

Info content is as follows

<?php

Phpinfo ();

?>

Test content is as follows

< 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;

?>

< PHP

$mem = new Memcache;

$mem->connect ("192.168.209.147", 11211);

$mem->set (' key ', ' This is a test! ', 0, 60);

$val = $mem->get (' key ');

Echo $val;

?>

http://192.168.209.147/info.php



Memcached Experiment (ii) PHP program call

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.