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 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b