lj2007331 9 anos atrás
pai
commit
52fe2aafd4
6 arquivos alterados com 86 adições e 6 exclusões
  1. 3 0
      config/laravel.conf
  2. 0 2
      config/phpwind.conf
  3. 1 2
      include/php-5.3.sh
  4. 1 1
      install.sh
  5. 80 0
      src/php5.3patch
  6. 1 1
      vhost.sh

+ 3 - 0
config/laravel.conf

@@ -0,0 +1,3 @@
+location / {
+    try_files $uri $uri/ /index.php?$query_string;
+}

+ 0 - 2
config/phpwind.conf

@@ -1,2 +0,0 @@
-rewrite ^(.*)-htm-(.*)$ $1.php?$2 last;
-rewrite ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 last;

+ 1 - 2
include/php-5.3.sh

@@ -18,7 +18,6 @@ src_url=http://downloads.sourceforge.net/project/mhash/mhash/$mhash_version/mhas
 src_url=http://downloads.sourceforge.net/project/mcrypt/MCrypt/$mcrypt_version/mcrypt-$mcrypt_version.tar.gz && Download_src
 src_url=http://mirrors.linuxeye.com/lnmp/src/fpm-race-condition.patch && Download_src
 src_url=http://www.php.net/distributions/php-$php_3_version.tar.gz && Download_src
-src_url=http://mirrors.linuxeye.com/lnmp/src/php5.3patch && Download_src
 
 tar xzf libiconv-$libiconv_version.tar.gz
 cd libiconv-$libiconv_version
@@ -34,7 +33,7 @@ cd libmcrypt-$libmcrypt_version
 ./configure
 make && make install
 ldconfig
-cd libltdl/
+cd libltdl
 ./configure --enable-ltdl-install
 make && make install
 cd ../../

+ 1 - 1
install.sh

@@ -36,7 +36,7 @@ IPADDR=`./include/get_ipaddr.py`
 PUBLIC_IPADDR=`./include/get_public_ipaddr.py`
 [ "`./include/get_ipaddr_state.py $PUBLIC_IPADDR`" == '\u4e2d\u56fd' ] && IPADDR_STATE=CN
 
-mkdir -p src $wwwroot_dir/default $wwwlogs_dir
+mkdir -p $wwwroot_dir/default $wwwlogs_dir
 
 # choice upgrade OS
 while :

+ 80 - 0
src/php5.3patch

@@ -0,0 +1,80 @@
+diff --git a/main/rfc1867.c b/main/rfc1867.c
+index b3f94ec..7613119 100644
+--- a/main/rfc1867.c
++++ b/main/rfc1867.c
+@@ -33,6 +33,8 @@
+ #include "php_variables.h"
+ #include "rfc1867.h"
+ #include "ext/standard/php_string.h"
++#include "ext/standard/php_smart_str.h"
++
+ 
+ #define DEBUG_FILE_UPLOAD ZEND_DEBUG
+ 
+@@ -462,6 +464,66 @@ static int find_boundary(multipart_buffer *self, char *boundary TSRMLS_DC)
+ static int multipart_buffer_headers(multipart_buffer *self, zend_llist *header TSRMLS_DC)
+ {
+ 	char *line;
++	mime_header_entry entry = {0};
++	smart_str buf_value = {0};
++	char *key = NULL;
++
++	/* didn't find boundary, abort */
++	if (!find_boundary(self, self->boundary TSRMLS_CC)) {
++		return 0;
++	}
++
++	/* get lines of text, or CRLF_CRLF */
++
++	while( (line = get_line(self TSRMLS_CC)) && line[0] != '\0' )
++	{
++		/* add header to table */
++		char *value = NULL;
++
++		/*if (php_rfc1867_encoding_translation(TSRMLS_C)) {
++			//self->input_encoding = zend_multibyte_encoding_detector((unsigned char *)line, strlen(line), self->detect_order, self->detect_order_size TSRMLS_CC);
++		}*/
++
++		/* space in the beginning means same header */
++		if (!isspace(line[0])) {
++			value = strchr(line, ':');
++		}
++
++		if (value) {
++			if(buf_value.c && key) {
++				/* new entry, add the old one to the list */
++				smart_str_0(&buf_value);
++				entry.key = key;
++				entry.value = buf_value.c;
++				zend_llist_add_element(header, &entry);
++				buf_value.c = NULL;
++				key = NULL;
++			}
++
++			*value = '\0';
++			do { value++; } while(isspace(*value));
++
++			key = estrdup(line);
++			smart_str_appends(&buf_value, value);
++		} else if (buf_value.c) { /* If no ':' on the line, add to previous line */
++			smart_str_appends(&buf_value, line);
++		} else {
++			continue;
++		}
++	}
++	if(buf_value.c && key) {
++		/* add the last one to the list */
++		smart_str_0(&buf_value);
++		entry.key = key;
++		entry.value = buf_value.c;
++		zend_llist_add_element(header, &entry);
++	}
++
++	return 1;
++}
++static int multipart_buffer_headers_bak(multipart_buffer *self, zend_llist *header TSRMLS_DC)
++{
++	char *line;
+ 	mime_header_entry prev_entry, entry;
+ 	int prev_len, cur_len;
+ 

+ 1 - 1
vhost.sh

@@ -234,7 +234,7 @@ if [ "$rewrite_yn" == 'n' ];then
 else
     echo
     echo "Please input the rewrite of programme :"
-    echo "${CMSG}wordpress${CEND},${CMSG}discuz${CEND},${CMSG}opencart${CEND},${CMSG}phpwind${CEND},${CMSG}typecho${CEND},${CMSG}ecshop${CEND},${CMSG}drupal${CEND},${CMSG}joomla${CEND} rewrite was exist."
+    echo "${CMSG}wordpress${CEND},${CMSG}discuz${CEND},${CMSG}opencart${CEND},${CMSG}laravel${CEND},${CMSG}typecho${CEND},${CMSG}ecshop${CEND},${CMSG}drupal${CEND},${CMSG}joomla${CEND} rewrite was exist."
     read -p "(Default rewrite: other):" rewrite
     if [ "$rewrite" == "" ]; then
     	rewrite="other"