• 締切済み

Ethnaの設定について

http://oshiete1.goo.ne.jp/qa3200000.html 上記を参考にみましたが、どうしても解決できないので教えてください。 質問内容も同じくWindowsでEthnaを使おうとしていますが、プロジェクトをWebに公開することができません。 ブラウザに下記のような表記が出ます。 ****************************************************************** Warning: main(Ethna/Ethna.php) [function.main]: failed to open stream: No such file or directory in C:\home\ethna\public_html\sample\app\Sample_Controller.php on line 20 Fatal error: main() [function.require]: Failed opening required 'Ethna/Ethna.php' (include_path='.:/usr/local/lib/php/Smarty;C:\home\ethna\public_html\sample/app;C:\home\ethna\public_html\sample/lib') in C:\home\ethna\public_html\sample\app\Sample_Controller.php on line 20 ****************************************************************** ディレクトリ構造は C:\ -- php\ -- PEAR\ -- Ethna、smarty、PEAR等 プロジェクトは C:\   home\ -- ethna\ -- public_html\ -- sample の中に入っており http://localhost/~ethna/sample/www/index.php にアクセスしています。 パスの指定が間違っているのだと思いますが どうしても解決できません。 アドバイスお願いします。

  • PHP
  • 回答数1
  • ありがとう数1

みんなの回答

回答No.1

基本的にindex.phpからController、Actionという流れがある以上、 Ethna_Controller等が継承出来る環境でなければなりません。 なので、Controllerのクラス定義前でinclude_pathを書き換えていると思います。 ethnaコマンドからプロジェクトを作成しているならControllerに 以下の記述があると思います。 /** アプリケーションベースディレクトリ */ define('BASE', dirname(dirname(__FILE__))); /** include_pathの設定(アプリケーションディレクトリを追加) */ $app = BASE . "/app"; $lib = BASE . "/lib"; ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . implode(PATH_SEPARATOR, array($app, $lib))); この辺変えてません? もしくはphp.iniで設定しているinclude_pathが '.:/usr/local/lib/php/Smarty' ってなってます。 上記スクリプトは、php.iniで設定されているinclude_pathに、 プロジェクトで利用するライブラリディレクトリ等を追記している 処理です。 なので、パッと見だと、php.iniで設定しているinclude_pathに 誤りがあると思われます。 C:/  php/   PEAR/    Ethna/     Ethna.php というディレクトリ構成と想定すると、 php.ini include_path = '.;C:/php/PEAR' と設定してapacheを再起動すれば良いと思います。

関連するQ&A

  • Ethnaの基本設定について

    はじめまして。Ethnaに関して質問したいことがあります。 現在WindowsでEthnaの環境設定をしているのですが、プロジェクトをWebに公開することができません。 ディレクトリ構造は C:\  php\ -- PEAR\ -- Ethna、smarty、PEAR等 programfile\ -- apache\ -- htdocs\ -- wwwディレクトリ内のコピー sample(プロジェクト)\ -- app -- www ・         ・ でhttp://localhost/sampleにアクセスしてもページが表示されません。 php.iniのinclude_pathはC:\php\PEARです。 リンクがうまくいってないのかと思うのですがどうしたらよいかわかりません。 Ethnaに詳しい方ご教授お願いいたします。

    • ベストアンサー
    • PHP
  • PHPエラーコードについて

    このようなエラーの場合どうすればいいのでしょうか?どなたか宜しくお願いいたします。 Warning: main(pager/pager.php) [function.main]: failed to open stream: No such file or directory in /home/○○○○/public_html/server/app/○○○○/○○○○.php on line 10 Fatal error: main() [function.require]: Failed opening required 'pager/pager.php' (include_path='../../pear:../../smarty:.:/usr/local/lib/php') in /home/○○○○/public_html/server/app/○○○○/○○○○.php on line 10

    • 締切済み
    • PHP
  • Ethnaでメール送信するには?

    下記のサイトを参考にEthnaの勉強をしています。 http://ethna.jp/ethna-document-dev_guide-app-mail.html ※環境はXAMPPを使用しています。 参考にしながらサンプルを作成していますがうまくいきません。 tplファイルは以下のフォルダに置いています。 C:\xampp\htdocs\sample\template\ja\mail [内容] From: xxx@yahoo.co.jp Subject: 入会に成功しました。 ようこそ{$username}さん。 うんたらかんたらほげほげ。 phpファイルは以下の場所に置いています。 C:\xampp\htdocs\sample\www [内容] <?php include_once('C:\xampp\php\PEAR\Ethna\class/Ethna_MailSender.php'); $ethna_mail =& new Ethna_MailSender($this->backend); $ethna_mail->send('xxx@yahoo.co.jp', 'welcome.tpl', array('username' => $regist_user)); ?> ブラウザで実行したら下記のエラーが表示されました。 Fatal error: Using $this when not in object context in C:\xampp\htdocs\sample\www\welcome.php on line 4 Ethnaでメール送信するにはどのようにしたらいいのでしょうか? アドバイス宜しくお願いします。

    • 締切済み
    • PHP
  • Smartyの設定について

    FedoraCore 4 MySQL 4.1.14 PHP 5.0.4    を使ってます。 Smartyを入れようと思い、Web上でいろいろ調べてやっているのですが、うまく動きません。 解凍したSmartyをフォルダごと /usr/local/lib/php/Smarty に移動し、 /etc/php.ini の中のinuclude_pathを include_path = ".:/usr/local/lib/php:/usr/local/lib/php/Smarty" としました。 そして、Demoフォルダを /var/www/html/demo/に移動してブラウザ上でdemoを見ているのですが、下記のエラーがでてしまいます。 Warning: main(/usr/local/lib/php/Smarty/Smarty.class.php) [function.main]: failed to open stream: No such file or directory in /var/www/html/demo/index.php on line 3 Fatal error: main() [function.require]: Failed opening required '/usr/local/lib/php/Smarty/Smarty.class.php' (include_path='.:/usr/local/lib/php/Smarty') in /var/www/html/demo/index.php on line 3 エラーの内容を見てみると Smarty.class.phpを呼び出すには /usr/local/lib/php/Smarty/lib/Smarty.class.phpとなっていないとおかしいと思うのですが、このあたりどう設定してよいのかわかりません。 Smartyの基本的な設定を何卒ご教授ください。

    • ベストアンサー
    • PHP
  • OpenPNEについての質問

    OpenPNEについての質問です。インストール時に下記のエラーがでてしまい対処に困っています。どこがどう悪いのか見当がつかない状態です。ご存じの方対処法をお願いします。 Warning: main(PHP/Compat/Function/image_type_to_mime_type.php) [function.main]: failed to open stream: No such file or directory in /home/xxxxxx/webapp/init.inc on line 30 Warning: main() [function.include]: Failed opening 'PHP/Compat/Function/image_type_to_mime_type.php' for inclusion (include_path='/home/xxxxxx/lib/include:/home/xxxxxx/webapp/lib:.:/usr/local/lib/php') in /home/xxxxxx/webapp/init.inc on line 30 Warning: main(Smarty/Smarty.class.php) [function.main]: failed to open stream: No such file or directory in /home/xxxxxx/webapp/lib/OpenPNE/Smarty.php on line 7 Fatal error: main() [function.require]: Failed opening required 'Smarty/Smarty.class.php' (include_path='/home/xxxxxx/lib/include:/home/xxxxxx/webapp/lib:.:/usr/local/lib/php') in /home/xxxxxx/webapp/lib/OpenPNE/Smarty.php on line 7

  • Smartyエラーについて

    いつもお世話になっております。 Smartyのエラーが解決できなくて困っています。 お手数ですが、後教授願えないでしょうか。 使用環境:Ubuntu Eclipse [エラー] Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'list.tpl'' in /home/mobapendev/public_html/Smarty/sysplugins/smarty_internal_template.php:163 Stack trace: #0 /home/mobapendev/public_html/Smarty/sysplugins/smarty_internal_template.php(550): Smarty_Internal_Template->isExisting(true) #1 /home/mobapendev/public_html/Smarty/Smarty.class.php(338): Smarty_Internal_Template->getRenderedTemplate() #2 /home/mobapendev/public_html/Smarty/Smarty.class.php(382): Smarty->fetch('list.tpl', NULL, NULL, NULL, true) #3 /home/mobapendev/public_html/mobapen/list.php(20): Smarty->display('list.tpl') #4 {main} thrown in /home/mobapendev/public_html/Smarty/sysplugins/smarty_internal_template.php on line 163 ディレクトリ構成 Smarty/Smarty.class.php Project/list.php Project/php/common.php project/smarty/templates/list.tpl project/smarty/templates_c project/smarty/cache project/smarty/configs となっており、 common.phpにて、 $dir = getcwd(); $smarty->template_dir=$dir .'/smarty/templates'; $smarty->compile_dir=$dir .'/smarty/templates_c'; $smarty->config_dir=$dir .'/smarty/configs'; $smarty->cache_dir =$dir .'/smarty/cache'; list.phpにて require_onceで取り込みまいしたが、 $smarty->display("list.tpl"); ディレクトリは間違っていないとは思っているのですが、 どこでload出来てていなか分からず、攻め上げいている状況です。 以上、宜しくお願い致します。

    • ベストアンサー
    • PHP
  • php my adminで編集していたところ下記のエラーが出てしまいま

    php my adminで編集していたところ下記のエラーが出てしまいましたが、原因がわかりません。わかる方教えていただければと思います。 Warning: main(./libraries/db_info.inc.php): failed to open stream: No such file or directory in /var/www/html/africanforest/public_html/phpMyAdmin/db_structure.php on line 32 Warning: main(./libraries/db_info.inc.php): failed to open stream: No such file or directory in /var/www/html/africanforest/public_html/phpMyAdmin/db_structure.php on line 32 Fatal error: main(): Failed opening required './libraries/db_info.inc.php' (include_path='.:/usr/share/pear:/usr/share/smarty') in /var/www/html/africanforest/public_html/phpMyAdmin/db_structure.php on line 32

  • PEARについて

    いつも拝見させていただいております。 <環境> Red Hat Enterprise Linux ES v.4 PHP 4.4.2(cli) この度、PHPをソースからインストールしました。 PEARを使いたいと思っておりますが、何からすればいいのか分からずに困っています 。 include_path は、「.:/usr/local/lib/php」となっており インストールディレクトリで # pear をすると Warning: main(Console/Getopt.php): Failed to open syream: No such file or directory in System.php on line 27 Fatal error: main(): Failed opening required 'Console/Getopt.php' (include_path='/usr/local/lib/php') in /usr/local/lib/php/System.php on line 27 とエラーになってしまいます。 ご教授お願いいたします。

    • 締切済み
    • PHP
  • Ethnaでのsection使用法

    みなさん、はじめまして。 PHPを勉強したての初心者ですが、宜しくお願いします。 Ethnaを利用していて、テンプレートにテーブルを出力したいのですが、うまいきません、、       viewでは以下のように変数をセットしているのですが、どこがいけないのでしょうか? どなたか、ご指導のほどよろしくお願いします。 <php>     $this->af->getAppNE('hiduke',"$hiduke"); $this->af->getAppNE('ninzu',"$ninzu"); <テンプレート> {section name="$app_ne.hiduke" loop=$hiduke} {$smarty.section.hiduke.first} <tr bgcolor="ffffff"> <td align="center"><b>{$app_ne.$hiduke}</b></td> {$smarty.section.hiduke.last} {$smarty.section.ninzu.first} <td align="right"><b>{$app_ne.$ninzu}</b></td> </tr> {$smarty.section.ninzu.last} {/section}

    • ベストアンサー
    • PHP
  • いつもお世話になっております。

    いつもお世話になっております。 小生、只今WindowsXPSP3上でXAMPP1.7.1を使用し、PHPを勉強しているPHP初心者です。 今回皆様にご質問させて頂きたい内容はXAMPPにSmatyをインストールするべきかしないべきかです。 私の環境でXAMPPのフォルダ内で「smarty」というキーワードを入れ、検索してみたところ、以下のファイルが検出されました。 smarty ディレクトリ     C:\xampp\htdocs\xoops\class Smarty.class.php       C:\xampp\htdocs\xoops\class\smarty Smarty_Compiler.class.php   C:\xampp\htdocs\xoops\class\smarty Smarty-2.6.0 ディレクトリ  C:\xampp\php\PEAR\PhpDocumentor\phpDocumentor core.assign_smarty_interface.php C:\xampp\htdocs\xoops\class\smarty\core core.smarty_include_php.php  C:\xampp\htdocs\xoops\class\smarty\core SmartyTask.php C:\xampp\php\PEAR\phing\tasks\ext smarty ディレクトリ C:\xampp\htdocs\extras\extra_languages\pt_utf8\html\class Smarty ディレクトリ C:\xampp\php\PEAR\PhpDocumentor\phpDocumentor\Converters\HTML Smarty.class.php C:\xampp\php\PEAR\PhpDocumentor\phpDocumentor\Smarty-2.6.0\libs Smarty_Compiler.class.php C:\xampp\php\PEAR\PhpDocumentor\phpDocumentor\Smarty-2.6.0\libs HTMLSmartyConverter.inc C:\xampp\php\PEAR\PhpDocumentor\phpDocumentor\Converters\HTML\Smarty core.assign_smarty_interface.php C:\xampp\php\PEAR\PhpDocumentor\phpDocumentor\Smarty-2.6.0\libs\core core.smarty_include_php.php C:\xampp\php\PEAR\PhpDocumentor\phpDocumentor\Smarty-2.6.0\libs\core 以上のファイルがあっても、XAMPPにSmartyをインストールしなければ、Smartyの機能は使えないのでしょうか?? また、上記の設定(Smartyをインストールしていない状態)でC:\xampp\sample\templatesフォルダを作成し、以下の.tplファイルを作成しました。 -----.tplファイル------ <html> <head> <title>smatyのテスト</title> </head> <body> ようこそ、($name)さん<br/> Hello World! </body> </html> そしてその上位フォルダにindex.phpを作成しました。 -----index.php----- <?php require_once "Smarty.class.php"; $smarty = new Smarty; $smarty->assign('name', '桃太郎'); $smarty->;display('index.tpl'); ?> 上記の2ファイルを作成し、http://localhost/sampleにアクセスしても、 「Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'{'' or `'$'' in C:\xampp\htdocs\sample\index.php on line 6」のエラーが出現し、正確に表示されません。 お忙しい中、大変申し訳ございませんが、先輩方アドバイス宜しくお願い致します。

    • ベストアンサー
    • PHP

専門家に質問してみよう