As we all know, the file format is diverse, and PHP is one of them. It is a script language embedded in HTML documents that is executed on the server side. The language style is similar to C language, but for many computer Xiaobai, how to open it is a problem, but it is actually very simple.
What software is used to open php files?
1) Open with Notepad
① Right click the php file and select "Open (o)" in the pop-up list, as shown in the following figure.
② Select Notepad from the options of opening mode.
③ Then you can see the PHP code in Notepad, as shown in the following figure.
2) Open with Notepad++
① Mouse php file, select "Notepad++" in the list that appears, as shown in the following figure.
② Then you can see the php code opened in Notepad++as shown in the following figure. You can see that the php code displays different colors at this time, which is the highlight of Notepad++.
3) Open with UltraEdit
Open it with UltraEdit, and you can see that the code display is different. Different editors display different highlights, which can be adjusted by yourself.
How to quickly convert php format to mp4?
Configure the php.ini file
File_uploads=on;//The switch to allow uploading files via HTTP. It is ON by default
Upload_tmp_dir;//The file is uploaded to the place where temporary files are stored on the server. If not specified, the default temporary folder will be used
Upload_max_filesize=1024m;//The file size refers to the maximum file size allowed to be uploaded. The default is 2M, and we set it to 1G
Post_max_size=1024m;//It refers to the maximum value that can be received by the form POST to PHP. We also set it to 1G
Max_execution_time=3600;//The maximum running time (seconds) of each PHP page. The default value is 30 seconds, and it is set to one hour, because the subsequent transcoding time is very long.
Max_input_time=36000;//The maximum time required for each PHP page to receive data, 60 seconds by default
Memory_limit=8m;//The maximum memory consumed by each PHP page, 8M by default
File upload plug-in
Flame Rain recommends that you use uploadify, which is an upload plug-in of JQuery to display progress. Plug ins are easy to install. This is omitted.
However, there is a problem to be noted that non IE browser sessions will be lost. After checking a lot of data, the final reasons are:
Because uploadify, for example, uses a flash client, the useragent it generates is different from the browser's user agent.
Final solution:
//Add the session parameter to the upload parameter of upmodify, as follows:
scriptData: {"SESSION_ID":""},
//Add the following code on the server receiving page:
if(@$_REQUEST['SESSION_ID'] && ($session_id=$_REQUEST['SESSION_ID']) != session_id()){
session_destroy();
session_id($session_id);
@session_start();
}
This solves the problem that FLASH cannot correctly transfer pages
Video format conversion
The popular video format conversion software under Linux is FFMPEG. FFMPEG is a complete solution for recording, screenshots, conversion and streaming audio and video, and a set of leading audio/video codec class libraries. In addition to FFMPEG, we need an extension for transcoding to H264 format. (All software package download addresses are given at the end of the article)
Install the source code and install the h264 extension in the centos 5.4 environment
tar -xjvf x264-snapshot-20120718-2245-stable.tar.bz2
#Enter the unzipped source file directory
cd x264-snapshot-20120718-2245-stable/
./configure --prefix=/usr/local --enable-shared
make
make install
//Install the source code and install the ffmpeg with h264 extension in the Centos 5.4 environment
tar -xjvf ffmpeg-2.1.1.tar.bz2
//Enter the directory after decompression
cd ffmpeg-2.1.1
./configure --enable-gpl --enable-libx264
make
make install
//Reload configuration
lcfonfig
//Test whether the installation is successful
ffmpeg
If you see the following content, the installation is successful:
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Dec 17 2013 23:32:40 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-3)
configuration: --enable-libx264 --enable-gpl
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
Php calls ffmpeg transcoding video
$cmd = 'FFMPEG -i uploadfile/video/test.wmv -c:v libx264 -strict -2 uploadfile/mp4/test.mp4';
exec($cmd, $status);
Generally speaking, if you want to open a php file, you can use the notepad that comes with your computer. Through the above flowchart, I believe you all know that the steps are actually very simple, but it seems complicated.