xdebug
1 #!/usr/bin/env bash 2 PHP_DEBUG_SO_FILE='/party/apache/php5/lib/php/extensions/xdebug.so' 3 PHP_INI_PATH='/party/apache/php5/lib/php.ini' 4 PHP_BIN='/party/apache/php5/bin/php' 5 6 XDEBUG_CONFIG='\n[xdebug]\nzend_extension = xdebug.so\nxdebug.idekey = PHPSTORM\nxdebug.remote_enable = On\nxdebug.remote_autostart = Off\nxdebug.remote_connect_back = On\n; xdebug.remote_host = you host ip\nxdebug.profiler_enable_trigger = On\nxdebug.profiler_output_dir = /tmp/php_profiler\n; xdebug.profiler_output_name = cachegrind.out.%p' 7 8 status() { 9 ${PHP_BIN} -v | grep -o "Xdebug v[0-9.]*" 10 grep --color=auto xdebug ${PHP_INI_PATH} 11 } 12 13 restart_http() { 14 kill -9 `pidof httpd` 15 test -f /etc/cron.min/softdog.sh && /etc/cron.min/softdog.sh 16 } 17 18 install() { 19 status 20 21 if [[ ! -f ${PHP_DEBUG_SO_FILE} ]]; then 22 if [[ ! -f /tmp/xdebug.so ]]; then 23 curl http://code.sangfor.org/16767/tools/raw/master/php/xdebug-2.5.5.so -o /tmp/xdebug.so 24 fi 25 echo "Cp xdebug.so to ${PHP_DEBUG_SO_FILE}" 26 mv /tmp/xdebug.so ${PHP_DEBUG_SO_FILE} 27 fi 28 29 if [[ `grep -c "\[xdebug\]" ${PHP_INI_PATH}` -eq '0' ]]; then 30 echo "Added config" 31 echo -e ${XDEBUG_CONFIG} >> ${PHP_INI_PATH} 32 fi 33 34 mkdir -p /tmp/php_profiler; chown daemon:daemon /tmp/php_profiler 35 36 echo "Restart Apache" 37 restart_http 38 39 echo "Add query string to you url ?XDEBUG_SESSION_START=PHPSTORM or XDEBUG_PROFILE=on" 40 echo "Successful installation" 41 echo "Maybe you need to see http://code.sangfor.org/16767/tools/blob/master/php/fuck_ioncube.sh" 42 } 43 44 uninstall() { 45 status 46 sed -i '/xdebug/d' ${PHP_INI_PATH} 47 echo "Uninstall successfully" 48 49 echo "Restart Apache" 50 restart_http 51 } 52 53 case "$1" in 54 status) status ;; 55 install) install ;; 56 uninstall) uninstall ;; 57 *) 58 echo "Usage: $(basename -- "$0") {install|uninstall|status}" >&2 59 exit 3 60 ;; 61 esac 62 63 exit $?
人生还有意义。那一定是还在找存在的理由
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?