Results 1 to 15 of 15

Thread: Fatal error: Class 'SoapClient' not found

  1. #1
    Join Date
    Jun 2008

    Fatal error: Class 'SoapClient' not found

    Hi, Am trying to run a script locally on my mac from the terminal. I am getting this error:

    Fatal error: Class 'SoapClient' not found in /path/test.php on line 2

    I am using Mamp Pro. I have tried adding "extension=php_soap.so" to the php.ini file, but am still getting the error.

    Can anyone advise on what i can do, or tell me how I can check to confirm that the Soap library is installed?

    Thanks in advance.

  2. #2
    Join Date
    Jul 2009
    Falls Church, Va.
    Did you restart Apache in MAMP so changes to php.ini are picked up?

    If still error, post relevant code please.


  3. #3
    Join Date
    Jun 2008
    If i run the php info from MAMP (opens in a browser) i get:

    PHP Version 5.2.11
    Configure Command
    './configure' '--with-mysql=/Applications/MAMP/Library' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php5' '--exec-prefix=/Applications/MAMP/bin/php5' '--sysconfdir=/Applications/MAMP/conf/php5' '--with-soap' '--with-config-file-path=/Applications/MAMP/conf/php5' '--enable-track-vars' '--enable-bcmath' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config' '--with-sqlite' '--with-ttf' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-dbx' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007e' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-dbase' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl'

    But if i run "php -i" from the terminal i get:

    PHP Version => 5.2.11
    Configure Command => '/SourceCache/apache_mod_php/apache_mod_php-44.4/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--with-apxs2=/usr/sbin/apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' '--with-mysql-sock=/var/mysql' '--with-mysqli=/usr/bin/mysql_config' '--with-mysql=/usr' '--with-openssl' '--with-xmlrpc' '--with-xsl=/usr' '--without-pear'

    Why does the one opened from MAMP have the --enable-soap but not from the one in the terminal?? And how do I enable soap for the settings when using the terminal?


  4. #4
    Join Date
    Jan 2009
    Do you have two php.ini versions perhaps?

  5. #5
    Join Date
    Jun 2008
    I actually have 3 php.ini's on my computer for php5. But all have "extension=soap.so", so i can't see why in the terminal it wouldn't be set.
    Last edited by coldscooter; 12-16-2009 at 02:53 PM.

  6. #6
    Join Date
    Jul 2009
    Falls Church, Va.
    Other than MAMP weirdness....

    Part of the "php -i" output includes system and build date information. To compare all the PHP's installed on your Mac type in "locate php | grep bin/php" in Terminal to see where all the CLI php's are including path, the compare each as you did before (-i) but using the path for each. BTW, "which php" reveals the path of the one you used when you typed in "php -i" without specifying the path the first time. That's the one found in the system path.

    The CLI versions of each may have been built differently.

    Last edited by SrWebDeveloper; 12-16-2009 at 03:06 PM. Reason: clarification

  7. #7
    Join Date
    Jun 2008
    The terminal php -i is saying the exact same date and time as the one coming up from mamp in the browser... So why would it have less under the 'Configure Command'?

  8. #8
    Join Date
    Jun 2008
    Oops my mistake. No they do have different build dates. The one showing in the terminal is earlier by a month. How can I fix this?
    Last edited by coldscooter; 12-16-2009 at 03:16 PM.

  9. #9
    Join Date
    Jul 2009
    Falls Church, Va.
    Uncommenting the line in the correct php.ini to enable the soap extension in MAMP should be the fix, it sounds like. I wrote earlier, "Did you restart Apache in MAMP so changes to php.ini are picked up?" and you never responded to that.

  10. #10
    Join Date
    Jun 2008
    Yes i did try that and still the same problem. Also, mamp is showing that soap is enabled when i run phpinfo() from it's interface. It is when executing code from the terminal which is when I'm having the problems.
    Last edited by coldscooter; 12-16-2009 at 03:34 PM.

  11. #11
    Join Date
    Jul 2009
    Falls Church, Va.
    On *nix systems PHP is both installed as an Apache module for HTTP, and also as a separate CLI version used only for shell scripting. Both use the same php.ini. I don't know enough under the hood regarding how MAMP works. Maybe a MAMP guru can join in and confirm it is setup like *nix as I noted.

    If they confirm that...

    I doubt your web based script is using the CLI version so any weirdness doesn't matter. If it was, you'd use an exec or system call which seems silly, calling PHP CLI from within PHP! So I know you found weirdness with the CLI version, but simply forget about it. Let's refocus on the real issue at hand, the HTTP version of PHP which shows the extension loaded. If all this is true, at this point you're down to two likely causes:

    1) MAMP bug loading SOAP extension
    2) Your code

    If MAMP is installed differently and a MAMP guru can't help you here, time to visit the MAMP support forum or contact their tech support.

    Last edited by SrWebDeveloper; 12-16-2009 at 03:47 PM.

  12. #12
    Join Date
    Jun 2008
    Apparently the CLI uses it's own version of PHP separate to MAMP. This link seems like it can help me. http://forum.mamp.info/viewtopic.php...dbe7181d4302a1

    It says to make a symbolic link to the MAMP php version:

    [Make the symbollic link]:
    $ ln -s /Applications/MAMP/bin/php5/bin/php /usr/bin/php

    Problem is, it then says for me: "File exists".. So I am still stuck.
    Last edited by coldscooter; 12-16-2009 at 04:07 PM.

  13. #13
    Join Date
    Jul 2009
    Falls Church, Va.
    Quote Originally Posted by coldscooter View Post
    But I can run php files from the terminal without mamp even running. Just don't have any mysql then...
    For the record, I've offered my suggestion for the problem in your OP, what follows is in response to your latest query which is a side issue. If you need to access your database via PHP5 CLI the support can be added during compilation via:

    '--with-mysql' '--with-mysqli'
    You can also use php -m to list compiled in versions to double check what's in your CLI or not.


  14. #14
    Join Date
    Jun 2008
    So I guess my revised question is how do i modify the 'Configure Command' for the terminal?

  15. #15
    Join Date
    Jul 2009
    Falls Church, Va.
    Only since you asked...

    I wish to emphasize this has nothing to do with MAMP which handles the installation for you, nor does it have anything to do with the advice I offered earlier to resolve MAMP. With that disclaimer noted, to manually compile any Linux source distribution, i.e. PHP source downloaded from php.net, a beginner's guide can be found here:


    Step 2 deals with your specific question and the two mysql compile options I listed in the earlier reply are passed as arguments to ./configure if that version of PHP doesn't enable it by default. If you have no idea what I just said you should not be doing this. So I close with...

    Warning: This is a good way to mess up your Mac if you don't know what you're doing. This is not for novices, Linux experience is a must as most guides like this one assume no errors occur during the many steps involved and offer limited to zero help if they do occur.

    Need to scoot. Cheers.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.24079 seconds
  • Memory Usage 3,010KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (15)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (15)postbit
  • (15)postbit_onlinestatus
  • (15)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates