Giter VIP home page Giter VIP logo

Comments (3)

tmsdy avatar tmsdy commented on September 28, 2024

历尽千辛万苦才跳过了这个坑(win的路径全都要重新弄,并且swoole版本的php是用的Cygwin,路径要用/cygdrive/d/web/ 这样的格式)

另外swoole版本的php 执行shell_exec始终不成功,就换了个获取音乐长度的方案,用 getid3 (https://sourceforge.net/projects/getid3/) 替换了用python的方案。

然而还是没成功,错误如下
TIM截图20191205122501

from syncmusic.

kasuganosoras avatar kasuganosoras commented on September 28, 2024

Windows 下可以使用 proc_open 替代 shell_exec 函数

function win_exec($command) {
	$descriptorspec = array(
		0 => array("pipe", "r"),
		1 => array("pipe", "w"),
		2 => array("pipe", "r")
	);
	$process = proc_open($command, $descriptorspec, $pipes);
	$result = "";
	if (is_resource($process)) {
		while(!feof($pipes[1])) {
			$resule .= fread($pipes[0], 8192);
			$resule .= fread($pipes[1], 8192);
			$resule .= fread($pipes[2], 8192);
		}
		fclose($pipes[1]);
		fclose($pipes[0]);
		fclose($pipes[2]);
	}
	return $result;
}

另外可以尝试使用 WSL 子系统来运行

from syncmusic.

tmsdy avatar tmsdy commented on September 28, 2024

谢谢大佬 这个问题应该可以关了,我还有其它的问题,重新开一个

from syncmusic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.