问题描述
最近,我在本地服务器上安装了 jalali 日历 https://github.com/morilog/jalali
实际上是通过运行
作曲家需要 morilog/jalali:3
在phpstorm的终端中,我的项目根据波斯格式检索日期,而当我上传到服务器并尝试使用此功能时,控制器无法保存有效数据。 以下代码属于在本地主机上正常工作的控制器。
function update_msg(Request $request)
{
if($request->ajax())
{
$msg_user1=$request->msg_user;
$msg_admin1=$request->msg_admin;
//$time2=time();
$time2=jdate();
//$time2="123456789";
try {
// Validate the value...
if(DB::table('user_msg')
->where('id',$request->id_ajax)
->update(['msg'=>$msg_user1,'msg_response'=>$msg_admin1,'date_response'=>$time2]))
{
echo '<div class="alert alert-success">Your Update is successful</div>';
}
else
{
echo '<div class="alert alert-danger">Update has Issue</div>';
}
} catch (Exception $e) {
echo '<div class="alert alert-success">unexpected error occur</div>';
//return false;
}
//$link_type=$request->link_type_ajax;
}
}
当我替换 $time2="123466";
而不是 $time2=jdate();
时,更新函数运行没有任何问题。
总而言之,这个函数(我的意思是 Jdate()
)无法在服务器上正确执行。同时,我没有任何权限通过cpanel访问在共享服务器上运行composer的上述命令。
如果可能,请告诉我如何在服务器上安装和执行此功能。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)