私はこのような構造を持っています:
---index.php (Slim index file)
---view
------css
------js
------img
------header.php
------footer.php
------index.php
------student
-----index.php
-----enrolment.php
-----course
------index.php
------exam.php
header.phpとfooter.phpは、studentフォルダーとcourseフォルダー内のすべてのビューファイルで使用されます。次を使用するだけで、ローカルマシンにそれらをうまく含めることができます。include "/view/header.php"; 「/view/footer.php」を含めます。
ただし、PHPFogクラウドにデプロイした場合は機能しないようです。発生するエラーは次のとおりです。
Code: 2
Message: include(/view/header.php): failed to open stream: No such file or directory
File: /var/fog/apps/app58082/calert.phpfogapp.com/view/student/index.php
何をすべきかアイデアはありますか?