这篇文章小编就为大家带来一篇关于php cli运行代码,php cli模式直接执行代码,php client运行php代码。小编觉得挺不错的,现在就分享给大家,如果你在找php命令行代码,php命令行,php cli运行php,也可以做个参照。一起跟随小编过来看看吧。
php cli运行代码,php cli模式直接执行代码,php client运行php代码
作者:小程序教员 发布时间:2019-06-17
                                                    通常php有两种运行模式,
我们最常用的是php-fpm模式,
即nginx,apache通过php-fmp模式访问php文件,
然后把解析后的内容返回给访问者。
另外一种就是php CLI模式,
CLI 是Command Line Interface,
意思是 命令行接口
下面谈谈怎么在php cli模式下运行php命令,
因为有时使用CLI模式更加方便…
 一、 先把php程序所在路径添加到环境变量
二、 php cli模式下使用 -r 参数直接运行php代码
一、 先把php程序所在路径添加到环境变量
二、 php cli模式下使用 -r 参数直接运行php代码
                                                                    
                                                            
                                                    
                        
                            
                        
                            
                        
                    
                     一、 先把php程序所在路径添加到环境变量
二、 php cli模式下使用 -r 参数直接运行php代码
一、 先把php程序所在路径添加到环境变量
二、 php cli模式下使用 -r 参数直接运行php代码
php -r 'echo "qinziheng";';qinzihengUsage: php [options] [-f] <file> [--] [args...]
   php [options] -r <code> [--] [args...]
   php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
   php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
   php [options] -S <addr>:<port> [-t docroot] [router]
   php [options] -- [args...]
   php [options] -a
  -a               Run as interactive shell
  -c <path>|<file> Look for php.ini file in this directory
  -n               No configuration (ini) files will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -f <file>        Parse and execute <file>.
  -h               This help
  -i               PHP information
  -l               Syntax check only (lint)
  -m               Show compiled in modules
  -r <code>        Run PHP <code> without using script tags <?..?>
  -B <begin_code>  Run PHP <begin_code> before processing input lines
  -R <code>        Run PHP <code> for every input line
  -F <file>        Parse and execute <file> for every input line
  -E <end_code>    Run PHP <end_code> after processing all input lines
  -H               Hide any passed arguments from external tools.
  -S <addr>:<port> Run with built-in web server.
  -t <docroot>     Specify document root <docroot> for built-in web server.
  -s               Output HTML syntax highlighted source.
  -v               Version number
  -w               Output source with stripped comments and whitespace.
  -z <file>        Load Zend extension <file>.
  args...          Arguments passed to script. Use -- args when first argument
                   starts with - or script is read from stdin
  --ini            Show configuration file names
  --rf <name>      Show information about function <name>.
  --rc <name>      Show information about class <name>.
  --re <name>      Show information about extension <name>.
  --rz <name>      Show information about Zend extension <name>.
  --ri <name>      Show configuration for extension <name>.
声明:部分文章或图片未能及时与原作者取得联系,若来源标注错误或侵犯到您的权益烦请告知QQ:2334512685,我们会及时删除。
发布:秦子恒博客,欢迎转载分享,请保留出处。
php cli运行代码,php cli模式直接执行代码,php client运行php代码链接:https://www.qinziheng.com/details/8399/
                            php cli运行代码,php cli模式直接执行代码,php client运行php代码相关文章
                        
                                                                                    
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                            
                                                                         
        
 
		

 桂公网安备 45030202000054号
桂公网安备 45030202000054号