❶ 不懂php的慎进!如何保存网页中的“动态图片”
其实非常非常简单,用电脑里的IE临时文件夹查看图片的原始文件地址即可。
图片显示之前,它已经在你的电脑中被临时储存了,否则你是根本无法看到的(包括一切视频、动画、音频等等文件)。
你可以直接将图片在本地临时夹中复制,然后粘贴到新建文件夹中即可了,根本不需要那么多麻烦的技术
❷ 具有2年php程序开发经验 具体是指 哪些经验! 2年php开发一般达到 什么水平 如何判断自己的php 水平
2年的开发经验不包括入门学习过程。指的是有大概2年的完整PHP项目制作经历。
2年php开发经验水平至少:
能在Linux或Windows Server Edition下熟练配置PHP运行环境
能掌握正则表达式(这个很重要)、mysql数据库、文件与目录操作、COOKIE/SESSION
至少熟悉一种中型PHP框架(如ThinkPHP)
会使用至少一种成熟的CMS系统(如PHPCMS、DedeCMS、JOOMLA、Wordpress)
熟悉某种项目管理模式
不求精通但至少熟悉HTML、CSS、Javascript,还有AJAX
知道如何防止mysql注入、会使用验证码
最好还要掌握若干技巧,如:
利用SMTP发送邮件、用Curl或其他方式跨域读取文件、熟悉用JSON传送/保存数据
❸ php+curl获取的表单源码,以字符串转换为数组
function sendcheck($url,$code)
{
global $logger;
$ch = curl_init();
if(!$ch)return -1; //设置适当的参数
curl_setopt($ch, CURLOPT_URL , $url);//连接
if(!curl_setopt($ch, CURLOPT_HEADER, 0)) return -2; //发送,设置curl_exec执行结果返回,成功返回获得内容,否则false
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //返回值为空
if(!curl_setopt($ch,CURLOPT_TIMEOUT ,30))return -3; //执行curl操作最大时间为 10 s
if(!curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,30))return -4 ; //curl对外连接大时间为 10 s
$result = curl_exec($ch); //访问资源;
//服务器无响应或者网络连接错误处理,重新发送请求信息,最多10次,每次 10 s 间隔
for($i =0 ; $i <= 9; $i++ ){
if(!$result){ //上一次未得到数据
$result = curl_exec($ch); //下一次的数据发送;
}else{
$logger->info("已成功通知");
break;
}
}
if(!$result){
$logger->info("通知失败");
}
curl_close($ch); //关闭curl资源
}
❹ centos7安装php
centos7系统源码编译安装PHP7.3.5版本新增系统用户组和用户:
下载PHP7.3.5
[root@localhost~]#mkdirdevdir
[root@localhost~]#cddevdir/腔李
[root@localhostdevdir]#wget
-bash:wget:未找到命令
[root@localhostdevdir]#rpm-qa|grepwget
[root@localhostdevdir]#yum-yinstallwget
[root@localhostdevdir]#rpm-qa|grepwget
wget-1.14-18.el7.x86_64
下载PHP7解压编译
wget-c
编译参数解释
--with-fpm-user=webu--with-fpm-group=webg添加PHP运行用户和用户组
配置信息出庆饥错:
下载gcc软件编译器yuminstall-ygcc
configure:error:libxml2notfound..
下载libzip-1.5.2.tar.gz
解决libzip和cmake版本问题
重新配置PHP7编译环境参数
libzip-1.5.2无法安装誉圆返,已经取消了。
提示off_t类型没有定义undefind,解决方法:
编译安装
测试PHP是否安装成功
转载自:
阿里云默认centos7上怎么安装php
首先更新系统软件/str
$yumupdate
安装nginx/str/str
1.安装nginx源
$yumlocalinstall.安装nginx
$yuminstallnginx
3.启动nginx
$servicenginxstart
Redirectingto/bin/systemctlstartnginx.service4.访问http://你的ip/
如果成功安装会出来nginx默认的欢迎界面
安装MySQL5.7.*
/str
1.安装mysql源/str
$yumlocalinstall.安装mysql
$yuminstallmysql-community-server
确认一下mysql的版本,有时可能会提示mysql5.63.安装mysql的开发包,以后会有用
$yuminstallmysql-community-devel
4.启动mysql
$servicemysqldstart
Redirectingto/bin/systemctlstartmysqld.service5.查看mysql启动状态
$servicemysqldstatus
出现pid
证明启动成功
6.获取mysql默认生成的密码
$grep'temporarypassword'/var/log/mysqld.log2015-12-05T05:41:09.104758Z1[Note]@localhost:%G1Rgns!dD!v/str
加粗的就是生成的密码
7.换成自己的密码
$mysql-uroot-p
Enterpassword:输入上面的密码
成功输入后进入一下步,这里你估计会输入好几次才进去8.更换密码
mysqlALTERUSER'root'李并@'localhost'IDENTIFIEDBY'MyNewPass4!'这个密码一定要足够复杂,不然会不让你改,提示密码不合法;9.退出mysql;
mysqlquit;
10.用新密码再登录,试一下新密码
$mysql-uroot-p
Enterpassword:输入你的新密码
11.确认密码正确后,退出mysql;
mysql哪衫迹quit;
编译安装php7.0.0
/str
/str
1.下载php7源码包/str
$cd/rootwget-Ophp7.tar.gz.解压源码包/str
$tar-xvfphp7.tar.gz
3./str
$cdphp-7.0.1
4.安塌乱装php依赖包/str
/str
$yuminstalllibxml2libxml2-developensslopenssl-develbzip2bzip2-devellibcurllibcurl-devellibjpeglibjpeg-devellibpnglibpng-develfreetypefreetype-develgmpgmp-devellibmcryptlibmcrypt-develreadlinereadline-devellibxsltlibxslt-devel5.编译配置,这一步我们会遇到很多configureerror,我们一一解决,基本都是相关软件开发包没有安装导致/str
/str
$./configure
--prefix=/usr/local/php
--with-config-file-path=/etc
--enable-fpm
--with-fpm-user=nginx
--with-fpm-group=nginx
--enable-inline-optimization
--disable-debug
--disable-rpath
--enable-shared
--enable-soap
--with-libxml-dir
--with-xmlrpc
--with-openssl
--with-mcrypt
--with-mhash
--with-pcre-regex
--with-sqlite3
--with-zlib
--enable-bcmath
--with-iconv
--with-bz2
--enable-calendar
--with-curl
--with-cdb
--enable-dom
--enable-exif
--enable-fileinfo
--enable-filter
--with-pcre-dir
--enable-ftp
--with-gd
--with-openssl-dir
--with-jpeg-dir
--with-png-dir
--with-zlib-dir
--with-freetype-dir
--enable-gd-native-ttf
--enable-gd-jis-conv
--with-gettext
--with-gmp
--with-mhash
--enable-json
--enable-mbstring
--enable-mbregex
--enable-mbregex-backtrack
--with-libmbfl
--with-onig
--enable-pdo
--with-mysqli=mysqlnd
--with-pdo-mysql=mysqlnd
--with-zlib-dir
--with-pdo-sqlite
--with-readline
--enable-session
--enable-shmop
--enable-simplexml
--enable-sockets
--enable-sysvmsg
--enable-sysvsem
--enable-sysvshm
--enable-wddx
--with-libxml-dir
--with-xsl
--enable-zip
--enable-mysqlnd-compression-support
--with-pear
--enable-opcache
configureerror:
1.configure:error:xml2-confignotfound..
解决:
$yuminstalllibxml2libxml2-devel
2.configure:error:CannotfindOpenSSL'sevp.h
解决:
$yuminstallopensslopenssl-devel
3.configure:error:解决:
$yuminstallbzip2bzip2-devel
4.configure:error:-easy.hshouldbeincurl-dir/include/curl/解决:
$yuminstalllibcurllibcurl-devel
5.Ifconfigurefailstry--with-webp-dir=DIRconfigure:error:jpeglib.hnotfound.
解决:
$yuminstalllibjpeglibjpeg-devel
6.Ifconfigurefailstry--with-webp-dir=DIR
checkingforjpeg_read_headerin-ljpeg...yesconfigure:error:png.hnotfound.
解决:
$yuminstalllibpnglibpng-devel
7.Ifconfigurefailstry--with-webp-dir=DIR
checkingforjpeg_read_headerin-ljpeg...yescheckingforpng_write_imagein-lpng...yesIfconfigurefailstry--with-xpm-dir=DIR
configure:error:freetype-confignotfound.
解决:
$yuminstallfreetypefreetype-devel
8.configure:error:Unabletolocategmp.h解决:
$yuminstallgmpgmp-devel
9.configure:error:mcrypt.hnotfound.Pleasereinstalllibmcrypt.
解决:
$yuminstalllibmcryptlibmcrypt-devel
10.configure:error:Pleasereinstallreadline-Icannotfindreadline.h解决:
$yuminstallreadlinereadline-devel
11.configure:error:xslt-confignotfound.Pleasereinstallthelibxslt=1.1.0distribution解决:
$yuminstalllibxsltlibxslt-devel
6.编译与安装
$makemakeinstall
这里要make好久,要耐心一下
7.添加PHP命令到环境变量
$vim/etc/profile
在末尾加入
PATH=$PATH:/usr/local/php/bin
exportPATH
要使改动立即生效执行
$./etc/profile
或
$source/etc/profile
查看环境变量
$echo$PATH
查看php版本
$php-v
8.配置php-fpm
$cpphp.ini-proction/etc/php.ini
$cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf$cp/usr/local/php/etc/php-fpm.d//usr/local/php/etc/php-fpm.d/cpsapi/fpm/init.d.php-fpm/etc/init.d/php-fpm$chmod+x/etc/init.d/php-fpm
9.启动php-fpm
$/etc/init.d/php-fpmstart
配置nginx虚拟机,绑定域名/str
1.
/str
$vim/etc/nginx/conf.d/php7.thinkcmf.com.conf这里可以把php7.thinkcmf.com.conf改成自己的域名把下面的内容复制到php7.thinkcmf.com.conf里server{
listen80;
server_namephp7.thinkcmf.com;
root/var/www/html/php7.thinkcmf.com;#该项要修改为你准备存放相关网页的路径location/{
indexindex.phpindex.htmlindex.htm;
#如果请求既不是一个文件,也不是一个目录,则执行一下重写规则if(!-e$request_filename)
{
#地址作为将参数rewrite到index.php上。
rewrite^/(.*)$/index.php/$1;
#若是子目录则使用下面这句,将subdir改成目录名称即可。
#rewrite^/subdir/(.*)$/subdir/index.php/$1;}
}
#proxythephpscriptstophp-fpm
location~.php{
includefastcgi_params;
##pathinfo支持start
#定义变量$path_info,用于存放pathinfo信息set$path_info"";
#定义变量$real_script_name,用于存放真实地址set$real_script_name$fastcgi_script_name;#如果地址与引号内的正则表达式匹配
if($fastcgi_script_name~"^(.+?.php)(/.+)$"){#将文件地址赋值给变量$real_script_name
set$real_script_name$1;
#将文件地址后的参数赋值给变量$path_info
set$path_info$2;
}
#配置fastcgi的一些参数
fastcgi_paramSCRIPT_FILENAME$document_root$real_script_name;fastcgi_paramSCRIPT_NAME$real_script_name;fastcgi_paramPATH_INFO$path_info;
###pathinfo支持end
fastcgi_intercept_errorson;
fastcgi_pass127.0.0.1:9000;
}
}
2.重启nginx
$servicenginxreload
3.
$vim/var/www/html/php7.thinkcmf.com/index.php/str
把下面的代码复制到这个文件里
?php
phpinfo();
4.查看访问
Centos7下PHP7最新版怎么安装步骤1:检查已安装的内核版本#uname-sr步骤2:在CentOS7中升级内核接下来,安装最新的主线稳定内核:#yum--enablerepo=elrepo-kernelinstallkernel-ml最后,重启机器并应用最新内核,困森链接着运行下面的命令检查汪孙最新内核版本还有一些代码我不想打了,楼主就自己去后盾人看看吧对你很春盯有帮助的
=0.11)'>CentOS7编译安装PHP7.4提示Nopackage'libzip'found或者(libzip>=0.11)编译安装PHP7.4提示Nopackage'libzip'found或者(libzip=0.11),原因凯稿是libzip没有安装或者版本太低,解决方法如枝镇下:
安装完成后,查看是否存在/usr/local/lib/pkgconfig目录,如果存在,执行如下命令来设猛孙粗置PKG_CONFIG_PATH:
❺ 大神,我用php中的正则获取小说的章节内容,为什么获取的是空的,我不知道哪里错了.
echo" 抓取网页======================================= ";
functiongetHTTPS($url){
$ch=curl_init();
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);
curl_setopt($ch,CURLOPT_HEADER,false);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_REFERER,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
$result=curl_exec($ch);
curl_close($ch);
return$result;
}
$result=getHTTPS("当前网址");
if(preg_match_all("/<li>(?:(?!</li>)[sS])*</li>/i",$result,$m)){
for($j=0;$j<count($m[0]);$j++){
echo$m[0][$j]." ";
}
}
❻ php获取网页源码内容有哪些办法
可以参考以下几种方法:
方法一: file_get_contents获取
<span style="white-space:pre"></span>$url="http://www..com/";
<span style="white-space:pre"></span>$fh= file_get_contents
('http://www.hxfzzx.com/news/fzfj/');<span style="white-space:pre"></span>echo $fh;
拓展资料
PHP(外文名:PHP: Hypertext Preprocessor,中文名:“超文本预处理器”)是一种通用开源脚本语言。语法吸收了C语言、Java和Perl的特点,利于学习,使用广泛,主要适用于Web开发领域。PHP 独特的语法混合了C、Java、Perl以及PHP自创的语法。它可以比CGI或者Perl更快速地执行动态网页。
用PHP做出的动态页面与其他的编程语言相比,PHP是将程序嵌入到HTML(标准通用标记语言下的一个应用)文档中去执行,执行效率比完全生成HTML标记的CGI要高许多;PHP还可以执行编译后代码,编译可以达到加密和优化代码运行,使代码运行更快。