반응형

$ php -i

반응형

'Programming > PHP' 카테고리의 다른 글

date 계산  (0) 2016.05.26
Fatal error: Maximum execution time of 30 seconds exceeded  (0) 2015.10.22
error 메세지 출력  (0) 2015.10.22
bitnami  (0) 2015.10.21
phpexcel 설치  (0) 2015.10.13
반응형

date1 = date('Ymd'His); //20160526000000

date2 = date('YmdHis',strtotime("-1800 secode")); //현재날짜에서 1800초를 뺀다.


$today = time(); //1462933266

$todaytime = $today - 86400; //86400초를 뺀다.

$todayYmd = date('Ymd', strotime('-7 day', $today)); //20160503




반응형

'Programming > PHP' 카테고리의 다른 글

콘솔에서 phpinfo 확인하기  (0) 2022.10.21
Fatal error: Maximum execution time of 30 seconds exceeded  (0) 2015.10.22
error 메세지 출력  (0) 2015.10.22
bitnami  (0) 2015.10.21
phpexcel 설치  (0) 2015.10.13
반응형

* 지정된 최대 실행 시간이 초과하여 발생한 에러


해결 방법

(1) php.ini의 max_execution_time를 늘려주기

max_execution_time= 0 (0 일 경우 메모리 제한이 없음.)

아파치 재실행 필요

(2) 해당 소스에만 메모리를 늘려주기.

   소스에 ini_set('max_execution_time',300); 추가 해주자.


반응형

'Programming > PHP' 카테고리의 다른 글

콘솔에서 phpinfo 확인하기  (0) 2022.10.21
date 계산  (0) 2016.05.26
error 메세지 출력  (0) 2015.10.22
bitnami  (0) 2015.10.21
phpexcel 설치  (0) 2015.10.13
반응형

ini_set('display_errors','on');

error_reporting(E_ALL);



php.ini 에서는

display_erros = On 으로 설정

반응형

'Programming > PHP' 카테고리의 다른 글

date 계산  (0) 2016.05.26
Fatal error: Maximum execution time of 30 seconds exceeded  (0) 2015.10.22
bitnami  (0) 2015.10.21
phpexcel 설치  (0) 2015.10.13
index.php 삭제하기  (0) 2015.09.09
반응형

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


- 버그인지 이유는 알 수 없으나..(캐쉬 문제도 아닌 것 같음.)

- 웹 소스가 변경이 되면 웹페이지에 바로 반영이 되지 않는다.

- 그래서 항상 아파치를 재시작후 변경된 웹페이지를 확인한다.

- mac에서만 그런줄 알았더니 windows에서도 동일한 증상을 확인함.

반응형

'Programming > PHP' 카테고리의 다른 글

Fatal error: Maximum execution time of 30 seconds exceeded  (0) 2015.10.22
error 메세지 출력  (0) 2015.10.22
phpexcel 설치  (0) 2015.10.13
index.php 삭제하기  (0) 2015.09.09
엑셀 다운로드 header 방식  (0) 2015.08.26
반응형

phpexcel 다운로드

- 알맞은 경로에 다운로드 후 압축을 풀어준다.

- 개인적으로 DocumentRoot에 PHPExcel 폴더안에 넣음.(/apache/htdocs/PHPExcel)


* 선언

include_once("../PHPExcel/ExcelClasses/PHPExcel.php");

반응형

'Programming > PHP' 카테고리의 다른 글

Fatal error: Maximum execution time of 30 seconds exceeded  (0) 2015.10.22
error 메세지 출력  (0) 2015.10.22
bitnami  (0) 2015.10.21
index.php 삭제하기  (0) 2015.09.09
엑셀 다운로드 header 방식  (0) 2015.08.26
반응형
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 파일을 생성해라.

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond $1 !^(index\.php|images|captcha|data|include|uploads|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ 어떤폴더/저런폴더/이런폴더/index.php/$1 [L] </IfModule>


sudo apachectl graceful  //아파치 재시작

localhost/index.php/test 에서 localhost/test 로 접속이 가능. 


반응형

'Programming > PHP' 카테고리의 다른 글

Fatal error: Maximum execution time of 30 seconds exceeded  (0) 2015.10.22
error 메세지 출력  (0) 2015.10.22
bitnami  (0) 2015.10.21
phpexcel 설치  (0) 2015.10.13
엑셀 다운로드 header 방식  (0) 2015.08.26
반응형

웹 소스 맨 상단에 추가 해줌.


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-check=0");

header("Pragma; public");



이걸 응용하여 버튼 클릭시 다운받게 해보자.


버튼 페이지(button.php)

<script>

    $.fn.outerHTML = function() {

         var el = $(this);

         if(!el[0]) return "";

         if(el[0].outerHTML) {

             return el[0].outerHTML;

         } else {

             var content = el.wrap('<p/>').parent().html();

             el.unwrap();

             return content;

         }

    }

function export_excel() {

var exp=$('#export').outerHTML();  //id 값이 export인 태그부터 가져옴.(위함수)

// var exp=$('#export').html(); => id값이 export 인 태그의 자식 태그들만 가져옴.

$('#data').val(exp);

$('#export_data').submit();

}

</script>

<div>

<input type="button" value="Excel" onclick="export_excel()">

<form id="export_data" method="post" action="./Excel.php">

<input type="hidden" id="data" name="data" />

</form>

</div>


다운로드 실행 페이지(Excel.php)

header("Content-Type: application/vnd.ms-excel");

header("Content-Disposition: attachment; filename=test.xls");

header("Content-Description:PHP4 Generated Data");


$data = $_REQUEST['data'];

echo "<meta content=\"application/vnd.ms-excel;charset=UTF-8;\" name=\"Content-type\">";

echo $data;


반응형

'Programming > PHP' 카테고리의 다른 글

Fatal error: Maximum execution time of 30 seconds exceeded  (0) 2015.10.22
error 메세지 출력  (0) 2015.10.22
bitnami  (0) 2015.10.21
phpexcel 설치  (0) 2015.10.13
index.php 삭제하기  (0) 2015.09.09

+ Recent posts