الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

تنصيب سمارتي << مشكلة

بدأه fatimah في 13 مارس 2012 · 0 رد · 627 مشاهدة · في منتدى تطوير المواقع بـ PHP
مشاركة: واتساب X فيسبوك تيليجرام
#1

بسم الله الرحمن الرحيم

احتاج مساعدة خبراء PHP , Smarty & Unix/Mac OS

جهازي ماك, والسرفر xampp احدث اصدارة للماك

ولاول مرة احاول تعلم نظام القوالب وحملت سمارتي

وقمت بتنصيب السمارتي ولكن في البداية كانت المشكلة كانه لا يتعرف على الملف Smarty.class.php ويذكر بانه غير موجود ولكنه كان موجود وحاولت حل المشكلة بالف طريقة وطريقة

ثم اصبحت المشكلة كانها في التصريح للمستخدم بقراءة وكتابة الملفات مع العلم بانني قمت بعمل الكود الاتي في الوحدة الطرفية Terminal

bash-3.2$ chown nobody:nogroup /Applications/XAMPP/xamppfiles/htdocs/guestbook/templates_c/
chown: /Applications/XAMPP/xamppfiles/htdocs/guestbook/templates_c/: Operation not permitted
bash-3.2$ chmod 775 /Applications/XAMPP/xamppfiles/htdocs/guestbook/cache/bash-3.2$

اخيرا الخطأ الحالي هو

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /Applications/XAMPP/xamppfiles/htdocs/guestbook/templates_c/wrt4f5e5cf567e692.00678741' in /Applications/XAMPP/xamppfiles/htdocs/Smarty/libs/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/Smarty/libs/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/Applications/X...', '<?php /* Smarty...', Object(Smarty)) #1 /Applications/XAMPP/xamppfiles/htdocs/Smarty/libs/sysplugins/smarty_internal_templatebase.php(155): Smarty_Internal_Template->compileTemplateSource() #2 /Applications/XAMPP/xamppfiles/htdocs/Smarty/libs/sysplugins/smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('index.tpl', NULL, NULL, NULL, true) #3 /Applications/XAMPP/xamppfiles/htdocs/guestbook/index.php(17): Smarty_Internal_TemplateBase->display('index.tpl') #4 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/Smarty/libs/sysplugins/smarty_internal_write_file.php on line 44

وكود البرمجة هو في مجلد باسم guestbook بداخل مجلد htdocs ,

باختصار شجرة العائلة كالتالي

مجلد المشروع guestbook/

بداخله المجلدات الخمسة الاتية

templates/

يحتوي على ملف القالب اندكس

index.tpl

templates_c/

configs/

cache/

htdocs/

يحتوي على ملف بي اتش بي اندكس

index.php

الكود بداخل الاندكس بي اتش بي هو

<?php
//define('SMARTY_DIR', '');
require_once('/Applications/XAMPP/xamppfiles/htdocs/Smarty/libs/Smarty.class.php');

$smarty = new Smarty();

//$smarty->template_dir = '/Applications/XAMPP/xamppfiles/htdocs/guestbook/templates/';
//$smarty->compile_dir  = '/Applications/XAMPP/xamppfiles/htdocs/guestbook/templates_c/';
//$smarty->config_dir   = '/Applications/XAMPP/xamppfiles/htdocs/guestbook/configs/';
//$smarty->cache_dir    = '/Applications/XAMPP/xamppfiles/htdocs/guestbook/cache/';

$smarty->assign('name','Ned');

//** un-comment the following line to show the debug console
//$smarty->debugging = true;

$smarty->display('index.tpl');

?>

والكود بداخل قالب الاندكس هو

<?php
require_once("Smarty.class.php");


$smarty->assign('alert','بسم الله الرحمن الرحيم');
$smarty->display('test.tpl');


?>

اتمنى احد يدلني على مصدر مفيد للتعلم عربي او انجليزي مافيش مشكلة

وربنا يوفق كل من يساعدني او تمنى ان يساعد ولم يستطع

تم تعديل هذه المشاركة بواسطة fatimah في 13 مارس 2012 في 00:26

مواضيع مشابهة