cakephp:在本地主机上有很多工作,但在我的VPS contabo上没有
我使用cakephp在网站上工作,该项目在本地主机上运行得非常好,但当我上传到我的CONTABO VPS时,我发现在功能(hasmany)中存在一个问题,即我失去了模型之间的关系 模型示例:cakephp:在本地主机上有很多工作,但在我的VPS contabo上没有,php,database,cakephp,has-many,vps,Php,Database,Cakephp,Has Many,Vps,我使用cakephp在网站上工作,该项目在本地主机上运行得非常好,但当我上传到我的CONTABO VPS时,我发现在功能(hasmany)中存在一个问题,即我失去了模型之间的关系 模型示例: public $belongsTo = array( 'category' => array( 'className' => 'categories', 'foreignKey' => 'id_category'
public $belongsTo = array(
'category' => array(
'className' => 'categories',
'foreignKey' => 'id_category'
)
);
public $hasMany = array(
'model_globale' => array(
'className' => 'model_globales',
'foreignKey' => 'id_type'
),
'typejobe' => array(
'className' => 'typejobes',
'foreignKey' => 'id_type'
)
);
因此,当我在localhost上调试时,我得到以下结果:
\app\Controller\ModelesController.php (line 70)
array(
(int) 0 => array(
'type' => array(
'id' => '1',
'name' => 'carte de visite',
'id_category' => '1',
'created' => '0000-00-00 00:00:00'
),
'category' => array(
'id' => '1',
'name' => 'Imprimerie',
'created' => '0000-00-00 00:00:00'
),
'model_globale' => array(
(int) 0 => array(
'id' => '22',
'id_type' => '1',
'id_job' => '1',
'id_chart_graphique' => '0',
'id_user' => '8',
'id_subtype' => '3',
'source' => '0',
'created' => '2014-01-07 09:57:39',
'modified' => '2014-01-07 09:57:39'
)
),
'typejobe' => array(
(int) 0 => array(
'id_type' => '1',
'id_jobe' => '1'
),
(int) 1 => array(
'id_type' => '1',
'id_jobe' => '2'
),
(int) 2 => array(
'id_type' => '1',
'id_jobe' => '5'
)
)
)
)
但在我调试CONTABO VPS时,我只得到:
array(
(int) 0 => array(
'type' => array(
'id' => '1',
'name' => 'carte de visite',
'id_category' => '1',
'created' => '0000-00-00 00:00:00'
)
)
)
托管项目时的主要问题是系统中的更改
- WAMP localhost:不区分大小写
- LINUX服务器:区分大小写
PS:您还必须检查递归属性。确保这两个属性中的数据相同environments@MoyedAnsari先生,我说过我抄过了!!所以数据库中有相同的行?