Hi,
I'm having trouble getting soap running in the CLI.
I haven't been able to find any information on this so far.
If anyone can help me out it would be much appreciated.

Thanks

    Kindly do not bump threads without good reason.

    You might want to state your version of PHP, and perhaps also the web server, and what you attempted.

      Sorry, I wasn't intending to bump. I'm new on here and i was trying to figure how to display php code properly.

      Anyways. I'm running PHP 5.2.4
      SOAP is working fine in Apache, but one of the scripts i have to run takes too long to be run in the browser. So i am running it using exec to run it in the background.

      The problem is that soap is not enabled in the CLI, and i am unsure of how to enable it.

      thanks.

        Have you checked into max_execution_time and set_time_limit?

        Also, I have a soap client that runs perfectly fine in the CLI (I am using PHP5's built-in SOAP functions). As I understand it, if it works in the browser, it will work in the CLI. What error(s) are you getting?

          its more a user response time than setting the execution time limits. some of these processes could take hours to complete so i cannot have the user waiting all that time

            the error im getting is that it cannot find the SoapClient class

              Is this Windows or Linux?

              "SoapClient class not found" generally means that SOAP has not been enabled. Does it work if invoked from a browser?

              Are you using the built-in SOAP stuff or something like NuSoap?

                using built in soap, in linux. soap works fine from a browser.
                this specific script works from a browser as well

                  Hmmmm - that is exactly what I have and it works fine from CLI.

                  What does the soap section from phpinfo say? This is what mine says:

                  Soap Client 	enabled
                  Soap Server 	enabled
                  
                  Directive			Local Value	Master Value
                  soap.wsdl_cache			1			1
                  soap.wsdl_cache_dir		/tmp		/tmp
                  soap.wsdl_cache_enabled	1			1
                  soap.wsdl_cache_limit		5		5
                  soap.wsdl_cache_ttl	86400		86400

                    there is no soap section when running phpinfo from cli
                    thats basically my problem, its not enabled and i cannot figure out how to enable it

                      OK, so now I'm totally confused.

                      There MUST be a soap section output from phpinfo() otherwise these two statements could not be true:

                      soap works fine from a browser.
                      this specific script works from a browser as well

                      Actually, they could be true if you were not using PHP's SOAP and were using a different SOAP (eg. Apache Axis) but, basically, if you have a PHP script that creates a (PHP5 built-in) SOAP client that works, you have to have a soap section as part of phpinfo() output.

                      Also, this statment has me confused:

                      So i am running it using exec to run it in the background.

                      Why would you need to exec a program from php when you are at the commandline already? If execing works, then just run the program.

                        ok, exec is being used to run a background script that is detached from the web script. so the user is on a page in their browser, they submit a form, and the script on the webpage uses exec to split the execution of a time consuming script away, so the user can continue on while the long script is run in the background

                        so soap is working from apache, but when i call exec, the script that i am running is not able to access the soap classes.

                        let me know if its still confusing

                          OK, now I understand. You are just doing a

                          exec('php myclient.php');

                          which is giving the error.

                          If you go to the command line and do

                          php myclient.php

                          i assume it also doesn't work.

                          What I don't understand is how a PHP SOAP client can work from the browser without a SOAP section in phpinfo().

                            OK, just had a thought.

                            You may have multiple copies of PHP on your server. The one Apache is using that has the SOAP library and the one set in your path that is being executed on the command line.

                            What does phpinfo() say about the location and version of PHP?

                            What does the CLI say about the location and version of PHP?

                              there is a soap section in phpinfo() when its called from the browser, just not when called from the command line

                                unfortunately the server that im working on is not responding right now. so ill get back to you when its back online with that.

                                  there is a soap section in phpinfo() when its called from the browser, just not when called from the command line

                                  Yep - that means that you are running a different PHP binary when on the command line than Apache is using. You will need to modify your $path or explicitly set the path when you do the exec (Or anytime you invoke php from the command line).

                                    ok thx.
                                    how do i set the path when i call exec?