どのように正確に動作させるのですか? メールの送信には Zend フレームワークを使用する必要があります。しかし、私のphpファイルにフレームワークを慎重に含めることができません。問題は、共有ホスティング サービスを使用していることが原因である可能性があります。
私は次のことをしました
- バージョン 2.x のフレームワークを含む Linux tgz ディストリビューションをダウンロードしました。
- それを解凍し、経由でフォルダーをアップロードしました。共有ホスティングに ftp します。
- Zend フォルダーをルートに配置しました。
php.ini ファイルにアクセスできないので、次の内容で新しいファイルを作成しました。
safe_mode = off SMTP = localhost smtp_port = 26 sendmail_from = web15.meebox.net include_path = /home/sammensp/public_html/Zend/library
フレームワークが機能するかどうかをテストするために、次のコードを php ファイルに配置しました。
require_once 'Zend/Mail/Message.php'; use Zend\Mail; $mail = new Mail\Message(); $mail->setBody('This is the text of the email.'); $mail->setFrom('domain@web15.meebox.net', 'Sender\'s name'); $mail->addTo('name@gmail.com', 'Name o. recipient'); $mail->setSubject('TestSubject'); $transport = new Mail\Transport\Sendmail(); $transport->send($mail);
問題は、次のエラーが発生することです。
Warning: require_once(Zend/Mail/Message.php) [<a href='function.require-
once'>function.require-once</a>]: failed to open stream: No such file or directory in
/home/sammensp/public_html/mobile/test.php on line 23
Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed
opening required 'Zend/Mail/Message.php'
(include_path='/home/sammensp/public_html/Zend/library') in
/home/sammensp/public_html/mobile/test.php on line 23
私の Web アプリと test.php ファイルは /public_html/mobile/test.php にあります。インクルード パスを次の include_path = /home/sammensp/public_html/Zend/library に設定しました。
私が間違ったことの解決策とそれを修正する方法を教えてもらえますか?