Posts Tagged php

Upgrade to latest version of PHP in VirtualMin on CentOS

0
Digg me

Get to a command prompt on your server with root access and run these commands:

  1. First, automatically configure yum to use these repositories on VirtualMin:
  2. rpm -ivh http://software.virtualmin.com/bleed/centos/5/i386/virtualmin-bleed-release-1.0-1.rhel.noarch.rpm
  3. yum update php
  4. Yes <– Prompt that you want to download and install
  5. php -v PHP
  6. Will show you your current version of PHP, mine was:
    • 5.2.17 (cli) (built: Jan 16 2011 22:13:08) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
  7. Restart Apache, I logged into the web gui for this because I can’t remember the /usr/sbin/blahblahblah command to restart Apache so do step 7 :p
  8. System Information > Status > Actions click “Restart Apache”, looks like double arrows

DONE!

, ,

No Comments

php判断字符串中是否包含某个字符的方法

0
Digg me
1 <?php 2 $string = www.rshining.com; 3 $some = "rshining"; 4 $num= explode($some, $string ); 5 if (count($num)>1): 6 echo "包含".$some; 7 else: 8 echo "不包含".$some; 9 endif; 10 ?>

No Comments