- Today
- 0
- Total
- 229,869
목록Programming/PHP (7)
개발은 너무해
date1 = date('Ymd'His); //20160526000000date2 = date('YmdHis',strtotime("-1800 secode")); //현재날짜에서 1800초를 뺀다. $today = time(); //1462933266$todaytime = $today - 86400; //86400초를 뺀다.$todayYmd = date('Ymd', strotime('-7 day', $today)); //20160503
* 지정된 최대 실행 시간이 초과하여 발생한 에러 해결 방법(1) php.ini의 max_execution_time를 늘려주기max_execution_time= 0 (0 일 경우 메모리 제한이 없음.)아파치 재실행 필요(2) 해당 소스에만 메모리를 늘려주기. 소스에 ini_set('max_execution_time',300); 추가 해주자.
ini_set('display_errors','on');error_reporting(E_ALL); php.ini 에서는display_erros = On 으로 설정
bitnami는 OS별로 Apache/MySQL/PHP를 한번에 설치할 수 있다. https://bitnami.com/stack/wamp : window용https://bitnami.com/stack/mamp : mac용https://bitnami.com/stack/lamp : 리눅스용 - 설치 중간에 phpMyAdmin을 제외하고 모두 체크해제.. - Database의 비번을 입력하라고 나옴... - 리눅스 설치(관리자 권한으로 실행하라) ex) sudo bitnami-lampstack-5.4-linux-x86_64.run - 버그인지 이유는 알 수 없으나..(캐쉬 문제도 아닌 것 같음.)- 웹 소스가 변경이 되면 웹페이지에 바로 반영이 되지 않는다.- 그래서 항상 아파치를 재시작후 변경된 웹페이지를 ..
* phpexcel 다운로드- 알맞은 경로에 다운로드 후 압축을 풀어준다.- 개인적으로 DocumentRoot에 PHPExcel 폴더안에 넣음.(/apache/htdocs/PHPExcel) * 선언include_once("../PHPExcel/ExcelClasses/PHPExcel.php");
httpd.conf 파일의 AllowOverride 부분을 All로 수정. AllowOverride 부분이 부분적으로 몇개 있을건데, 아래 주석처리로 인해 덩그러니 홀로 있는 부분을 수정해줘야 함. # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # # AllowOverride None AllowOverride All index.php에 .htaccess 파일을 생성해라. RewriteEngine On RewriteBase / Rewr..
웹 소스 맨 상단에 추가 해줌. header("Content-Type: application/vnd.ms-excel");header("Content-Disposition: attachment; filename=test.xls");header("Content-Description:PHP4 Generated Data"); 아래와 같은 헤더도 있으나, 현재까지는 위 3개로만으로도 다운이 가능하다.header("Content-Type: application/octet-stream");header("Content-Type-Description: File Transfer");header("Expires: 0");header("Cache-Control: must-revalidate, post-check=0,pre-c..