Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7186867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:43:22+00:00 2026-05-28T18:43:22+00:00

require_once does not seem to work. I am trying to use Zend libraries to

  • 0

require_once does not seem to work. I am trying to use Zend libraries to send mail but something does not work. I am using my web hosting server provider so I have to put the libraries in a subdirectory (without installing any framework).

// $path= dirname(__FILE__)."/ZendLibrary:".get_include_path() ;
$path= "./ZendLibrary".PATH_SEPARATOR.get_include_path() ;
set_include_path($path);
//echo $path ;

echo "Spot 0" ;
require_once 'Zend/Mail.php';
echo "Spot 1" ;

I got the “Spot 0” message but I don’t get the “Spot 1” message. I have selected only two Zend libraries:

 ZendLibrary/Zend/Mail/* (directory)
 ZendLibrary/Zend/Mime/* (directory)
 ZendLibrary/Zend/Mail.php (script)
 ZendLibrary/Zend/Mime.php (script)

ZendLibrary is a folder in the same directory where my script is. What could happening?

UPDATE#1:

My problem is that the code stops working right when I run require_once. It does not echo “Spot 1” message. I have tried absolute paths for set_include_path, I have tried to load a .php library script without internal require_once statements, but nothing makes it work. As my test is run from a web hosting site in the Internet I don’t have access to logs!.. or do I?

$path= realpath(dirname(__FILE__).'/ZendLibrary').PATH_SEPARATOR.get_include_path() ;
// $path= "./ZendLibrary".PATH_SEPARATOR.get_include_path() ;
set_include_path($path);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:43:23+00:00Added an answer on May 28, 2026 at 6:43 pm

    Answer:

    My ISP (web hosting too) has a setting to disable require_once. I was able to setup a Unbuntu virtual machine on VirtualBox and set up a web server. I copied the content of my test web site in my Unbuntu and find out that require_once does work as expected !!! That may explain why the server-side include did not work for me either. The following was a usefull check, that indicated me the file was in the expected place.

    $file = 'ZendLibrary/Zend/Mail.php'; 
    
    if ((!is_file($file)) or (!is_readable($file))) 
       die("File does not exists or is not readable."); 
    

    Now I have to find out why it is disabled, how to enable it, or just switch web hosting company. Update: I had to pay $20 dolars a year more for the provider to enable PHP (in this case to be able to include).

    This site can tell you more about it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it more efficient to use PHP's include_once or require_once instead of using a
The following pseudo code does not work the way I expect and I'm looking
I'm working on a large php site that currently does not use any framework.
The variable $a below does not seem to parse properly when if I attempt
What does MYSQL mean in the following code. require_once (MYSQL);
I'm using require_once() in header.php to include the FirePHP library. In the page.php I'm
Simple question. Why use require_once to include classes that you use within a file?
I'm trying to accomplish the following, I'm sending a HTML email using PHP Mailer
I have worked with globalization settings in the past but not within the .NET
I wrote a question earlier trying to get around using a controller in Kohana,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.