First check your current version on mac. Please enter below command in your terminal. Ex :- php -v Enter next command for uninstall the PHP on your system. Ex :- brew uninstall After select new version as you want to install, Please enter below command in your terminal. Ex :- brew install If you want to used in your valet system, Then please enter below command. Ex :- valet use After check your php version, Your php version updated in your system. 1. session 생성session_start() 로 세션을 생성 할수 있습니다. 예제
브라우저로 실행하면 아래와 같이 출력됩니다. PHP 세션은 위 그림과 같이 PHPSESSID 라는 이름으로 저장됩니다. 열어서 보시면 세션 변수로 지정한 값들을 확인 할수 있습니다. 2. session 삭제session_destroy() 로 삭제를 합니다. 2018-01-25 23:39:32 변경사항 index.php<?php function print_title(){ if(isset($_GET['id'])){ echo $_GET['id']; } else { echo "Welcome"; } } function print_description(){ if(isset($_GET['id'])){ echo file_get_contents("data/".$_GET['id']); } else { echo "Hello, PHP"; } } function print_list(){ $list = scandir('./data'); $i = 0; while($i < count($list)){ if($list[$i] != '.') { if($list[$i] != '..') { echo "<li><a href=\"index.php?id=$list[$i]\">$list[$i]</a></li>\n"; } } $i = $i + 1; } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> <?php print_title(); ?> </title> </head> <body> <h2><a href="index.php">WEB</a></h2> <ol> <?php print_list(); ?> </ol> <a href="create.php">create</a> <?php if(isset($_GET['id'])) { ?> <a href="update.php?id=<?=$_GET['id']?>">update</a> <form action="delete_process.php" method="post"> <input type="hidden" name="id" value="<?=$_GET['id']?>"> <input type="submit" value="delete"> </form> <?php } ?> <h2> <?php print_title(); ?> </h2> <?php print_description(); ?> </body> </html> delete_process.php<?php unlink('data/'.$_POST['id']); header('Location: /index.php'); ?> 1)php 및 모듈 확인 rpm -qa php rpm -qa | grep php 2)완전삭제 yum -y remove php* 3) 먼저 epel-releaseyum 저장소를 추가한다 yum install epel-release 운영체제 버전에 맞는 remi-release 설치 rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm (centos8) sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm yum --enablerepo=remi-php72 install php yum --enablerepo=remi-php72 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt php-mysql php-bcmath php-gd php-mysqlnd php-pear php-process php-devel php-json php-opcache php-pdo |