douzhu1188 2013-06-11 15:43
浏览 60
已采纳

当xampp portable安装在另一个驱动器中时,无法从命令行运行php cli

I have installed a xampp portable package on my drive D, added the php folder path inside it on the system environment so I would be able to run php basically anywhere from the command line. but when i try to check if its working by executing the "php -v" command, it runs but i get this following error/warning messages.

"Warning: PHP Startup: Unable to load dynamic library 'xampp-portable\php\ext[:any].dll - The specified module could not be found."

*the [:any] there just means some dll filename.

and i get a lot of that warnings with just varying dll filenames,

anyway, here's the catch. when i do change my current path in the command line to somewhere in drive D, and then run the same command "php -v" it runs smoothly.

so what configuration should i do to fix this problem?

by the way, i do the same with mysql, putting its bin directory path on the system enviroment, run it in both inside drive C and drive D. and it runs smoothly. so i guess this problem is only on php.

  • 写回答

2条回答 默认 最新

  • dtotuki47568 2013-06-13 03:00
    关注

    I've posted the same question in xampp forums and this is the answer that was given to me. I'll be quoting the answer as it was and give credit to the one who answere it.

    XAMPP is very proud that it don't have to set any environment variables or registry values.

    What you want to do is not possible with XAMPP portable without mapping to a specific Drive letter. All configurations in xampp portable have relative paths, so if you want to use cli from a different drive letter, php can be executed, but all extensions of them throw errors.

    I would install the full version of XAMPP, map it to the current drive letter with help of the setup_xampp.bat file and use the XAMPP control panel Shell instead of default command line (advantage: The XAMPP control panel shell sets local include paths to the needed XAMPP folders).

    Works for me (i can even use pear, git, composer, and other cli scripts with the Xampp Shell if correct integrated).

    best wishes, Altrea

    credits to Altrea

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?