Php 如何修复错误文件MTIME&;文件放置内容(?)[Laravel]
我在文件Php 如何修复错误文件MTIME&;文件放置内容(?)[Laravel],php,laravel,Php,Laravel,我在文件controller中有一个错误代码。错误:为什么我要从主机转移到本地。在我使用xampp的地方,我看到了这个错误。我的错误是: 错误文件\u放置\u内容: 文件内容(/home/xxxx/public\u html/xxx/index.phpclient/localhost/stylesheet.less): 无法打开流:中没有此类文件或目录 /home/xxxx/public_html/xxx/application/controller.php 错误exec(): 警告:出于安全原
controller
中有一个错误代码。错误:为什么我要从主机转移到本地。在我使用xampp的地方,我看到了这个错误。我的错误是:
错误文件\u放置\u内容:
文件内容(/home/xxxx/public\u html/xxx/index.phpclient/localhost/stylesheet.less):
无法打开流:中没有此类文件或目录
/home/xxxx/public_html/xxx/application/controller.php
错误exec():
警告:出于安全原因,已在中禁用exec()
/home/xxxx/public_html/xxx/application/controller.php联机
错误filemtime:
警告:filemtime():的stat失败
/home/xxxx/public\u html/xxx/index.phpclient/localhost/stylesheet.css
在/home/xxxx/public_html/xxx/application/controller.php中
这是我的代码:
public function get_client_css()
{
//$client = $GLOBALS['config']['real_path'] . 'client/' . $GLOBALS['config']['subdomain'];
$client = $GLOBALS['config']['real_path'] . 'client/' . $GLOBALS['config']['subdomain'];
$base = str_repeat('../', count($GLOBALS['request']));
$baseless = $GLOBALS['config']['real_path'] . 'assets/less/base.less';
$lessc = $GLOBALS['config']['app']['lessc'];
$fileless = $client . '/stylesheet.less';
$filecss = $client . '/stylesheet.css';
if(!file_exists($fileless))
{
//file_put_contents($fileless, "@import \"../../assets/less/base.less\";\n");
file_put_contents($fileless, "@import \"../assets/less/base.less\";\n");
}
if(file_exists($filecss))
{
$newless = filemtime($fileless) > filemtime($filecss);
$newbase = filemtime($baseless) > filemtime($filecss);
if($newless OR $newbase)
{
exec("$lessc \"$fileless\" \"$filecss\"");
}
}
else
{
exec("$lessc \"$fileless\" \"$filecss\"");
}
$time = filemtime($filecss);
return $base . 'client/' . $GLOBALS['config']['subdomain'] . '/stylesheet.css?m=' . $this->to_base($time);
}
我该怎么办?我认为没有更改代码:(您的父目录可能不存在,您可以在文件之前添加内容
如果(!file_存在($client))mkdir($client,0777,true);
您的父目录可能不存在,您可以在文件内容之前添加
如果(!file_存在($client))mkdir($client,0777,true);