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

  • Home
  • SEARCH
  • 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 7527539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:07:56+00:00 2026-05-30T04:07:56+00:00

We are updating our codebase to use the namespace functionality provided in PHP-5.3+ Previously,

  • 0

We are updating our codebase to use the namespace functionality provided in PHP-5.3+

Previously, our files all lived happily on the webserver in /htdocs/php but now we are separating our scripts, and putting our PHP libraries in /htdocs/php/lib/

In /htdocs/php/lib/ we have a file called Jira.php which we have given a namespace to:

<?php
# Define a namespace for this library
namespace Jira;

function create_client($jira_url, $options)
{
    global $client;

    try
    {
            $client = new SoapClient($jira_url, $options);
    }
    catch (Exception $error)
    {
            echo $error -> getMessage() . "<br/><p style='color:red'> Could not connect to Jira </p>";
    }
}
?>

However, when we try and call this function from a script in /htdocs/php, we are getting the class not found error:

PHP Fatal error:  Class 'Jira\SoapClient' not found

This is failing when we try creating the SoapClient object.

I have verified that I have the php-soap package installed in /usr/share/php/SOAP/
and php_info(); is showing that it is enabled etc.

So presumably this is a problem with the namespace convention. How do we include that class without it throwing an error?

Regards,
ns

  • 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-30T04:07:57+00:00Added an answer on May 30, 2026 at 4:07 am

    SoapClient is probably assigned to the global namespace.

    In your script the current namespace is Jira.

    Try using:

    $client = new \SoapClient($jira_url, $options); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We use TortoiseSVN for our code repository. Is it possible to check all files
I'm updating some of our legacy C++ code to use the MFC feature pack
After updating to php 5.3 one of our systems has developed an interesting bug.
I'm in the process of updating some old CSS files in our systems, and
We're updating our ancient internal PHP application at work. Right now, we gather extensive
I am working on an ASP.NET project where we are updating all of our
I'm working on updating one of our applications. It must use .NET 2.0. One
I am mass updating a SQL Server database. I am changing all our numeric(38,0)
We use log4net in all of our (many) in-house applications. We typically do what
I'm about to undertake updating our coding standards documentation and I am thinking of

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.