2015.03.25~26--php-fpm restart command under linux, php-fpm log, iconv function in pHP, export CSV format in PHP

Today's tasks:
1. Self-test in linux environment
2. Webserver details function improvement
3. Develop data export function

Actual :
Test in multiple environments, modify the following functions:
  1. Import and export function, prompt will overwrite data
  2. Modify $ .validator, mainly modify the html js file
  3. The export is completed 30%



harvest:
1. The php-fpm restart command under linux:
  direct installation: service php-fpm restart
  compile and install: absolute path start: ./etc/rc.d /init.d/php-fpm restart

2. Under linux, after the error log is enabled, it will be recorded in the php-fpm directory:
  /var/log/php-fpm/www-error.log


Today's tasks:
1. Development Data export function
2. Avatar management

Actual :
1. Complete csv export
2. Avatar table:
   id emp_id path mood
   1 1000810 /icon/enterprise_id/emp_id/timestamp happy
   2 1000811
   3 1000812
a. The user uploads the avatar, the server creates the directory and db_record
b. After the user logs in, the AB is synchronized, and the URL with the avatar is sent to


harvest:

1. Notice: iconv(): Detected an incomplete multibyte character in input string in /var/nginx /
  This is an error reported by the iconv() function. When the encoding method is incorrect during Chinese conversion, it will warn
  PHP to convert the string according to the required character encoding. The function is:
  string iconv ( string $in_charset , string $out_charset , string $str) Convert the character The string str is converted from in_charset to out_charset.
in_charset The character set of the input.

out_charset The character set of the output. 
If you add the string //TRANSLIT after out_charset, transliteration will be enabled. This means that when a character cannot be represented by the target character set, it can be approximated by one or more similar characters. If you add the string //IGNORE, characters that cannot be expressed in the target charset will be silently discarded. Otherwise, str is truncated from the first invalid character and results in an E_NOTICE.

str String to convert.

2. Export CSV format in PHP
// title row of csv
$str = "DepartmentName,ParentID,IsRoot,Emp_ID,Name,Sex,RoleType,SipURI,Email,Title,CellphoneNum,VirtulID,Ext,Address\n";

while (query data)
{
    $str .= $DepartmentName. "," .$ParentID. "," .$IsRoot. "," .$Emp_ID. "," .$Name. "," .$Sex. "," .$RoleType. "," .$SipURI.
 	 "," .$Email. "," .$Title. "," .$CellphoneNum. "," .$VirtulID. "," .$Ext. "," .$Address. "\n";  
}
export($str);

/*Export data file in CSV format*/
function export($data)
{
	$filename_export = date('Ymd').'.csv';

	header("Content-type:text/csv");
	header("Content-Disposition:attachment;filename=" . $filename_export);
	header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
	header('Expires:0');
	header('Pragma:public');
	echo $data;
}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327043119&siteId=291194637