7 Replies Latest reply on Dec 1, 2016 8:44 AM by BengtOxelman

    PHP memory issue?

    BengtOxelman

      Hi,

       

      I recently upgraded from Mavericks/OS Server/FM Server 12 to ELCapitan/OS Server/FM Server 15. It turned out that the Apache Server, which I use for a main webpage, which in turn uses PHP to get data from a FM database using the FMPHP API, didn't come to good terms with FM Server 15. SO I gave up and installed FM Server 15 on another machine. Now the Apache Server and the database server (including Web Server) work well. Power the FMPHP API doesn't seem to work. I either get:

       

      "XML error: No memory at line 1 (error )"

       

      or

       

      Communication Error: (22) The requested URL returned error: 502 - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.

       

      The first error could be due to that the table includes around 1000 records with many fields (some in related tables), according to other posts at this forum. However, I never encountered the problem with FM Server 12. The other error message, I have no idea. Any help would be greatly appreciated.

       

      Thanks!

        • 1. Re: PHP memory issue?
          user19752

          You can increase memory size in php.ini, I saw it is 128M.

          • 2. Re: PHP memory issue?
            bigtom

            You change this in something like the the php.ini. Different systems have different files. I believe there are settings for total memory allocated and the total allowed per request/process. I have sometimes set this up to 768M when needed.

             

            Not sure what your Web server is running on but something like OpCache can help a lot with precompiled php that gets used frequently. Never tried it with FMS though.

             

            FMI does not recommend running OS X Server app and FMS on the same machine. It is possible as long as you do not have any web services turned on.

            • 3. Re: PHP memory issue?
              CarlSchwarz

              ELCapitan/OS Server/FM Server 15

               

              FileMaker Server and OSX Server are not entirely compatible.  Test it by running FMServer on standard OSX instead if you can and see if that solves the communication error issue.  The WEB server is the primary issue of compatibility I believe.

               

              Here is some information on another forum about using OSX Server with FMS14 which may be helpful FM Server 14 Compatible with OS X Server? - FileMaker Server 14 - FMForums.com

               

              Add this to your PHP file which is throwing the error to increase the memory limit, but raise it higher than 128M, that is the standard value.  Just experiment for what works with your machine and the available RAM.

              ini_set("memory_limit", "128M");

              • 4. Re: PHP memory issue?
                BengtOxelman

                Thanks for the suggestion. The solution has been working since, but now I get these errors again. The database has not changed much, so the size of the the data is about the same. The only thing I can think of that  has changed is some changes to the firewall of the FM server machine. Any suggestions would be greatly appreciated

                • 5. Re: PHP memory issue?
                  CarlSchwarz

                  This is just a suggestion, perhaps an update to OSX Server has made some changes to Apache?  Try running the deployment assistant from the FileMaker Server admin page, or re-installing FileMaker Server and the installer may reconfigure Apache and make it work again.

                  • 6. Re: PHP memory issue?
                    BengtOxelman

                    Hi,

                     

                    I have re-installed everything, tried two-machine deployment, using the AppleServer web publishing, but the error remains. However, maybe there is some kind of connection problem to the FM database. I just found that connecting to the database with FileMakerPro Open Remote only works when I use FMPro 15, not FMpro 14 (Server is v15).

                     

                    When I add this code:

                     

                    $fm = new (‘BOxTax.fmp12’,’http://130.241.157.54:81');

                    //code to get user and password. User has fmphp permissions

                    $Databases = $fm->listDatabases();

                    print_r($Databases);

                     

                    I get this result

                     

                    FileMaker_Error Object ( [_fm] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://130.241.157.54:81 [recordClass] => FileMaker_Record [prevalidate] => [database] => BOxTax.fmp12 [username] => xxx [password] => xxxxxxxx ) [Vea4b3413] => [V9a3dcbce] => ) [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => 22 [message] => Communication Error: (22) The requested URL returned error: 404 Not Found - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user. [userinfo] => [backtrace] => Array ( [0] => Array ( [file] => /Library/FileMaker Server/Web Publishing/publishing-engine/php/el capitan/lib/php/PEAR.php [line] => 945 [function] => __construct [class] => PEAR_Error [type] => -> [args] => Array ( [0] => Communication Error: (22) The requested URL returned error: 404 Not Found - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user. [1] => 22 [2] => [3] => [4] => ) ) [1] => Array ( [file] => /Library/FileMaker Server/HTTPServer/htdocs/FileMaker/Error.php [line] => 52 [function] => PEAR_Error [class] => PEAR_Error [object] => FileMaker_Error Object *RECURSION* [type] => -> [args] => Array ( [0] => Communication Error: (22) The requested URL returned error: 404 Not Found - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user. [1] => 22 ) ) [2] => Array ( [file] => /Library/FileMaker Server/HTTPServer/htdocs/FileMaker/Implementation/FileMakerImpl.php [line] => 388 [function] => FileMaker_Error [class] => FileMaker_Error [object] => FileMaker_Error Object *RECURSION* [type] => -> [args] => Array ( [0] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://130.241.157.54:81 [recordClass] => FileMaker_Record [prevalidate] => [database] => BOxTax.fmp12 [username] => xxx [password] => xxxxxx ) [Vea4b3413] => [V9a3dcbce] => ) [1] => Communication Error: (22) The requested URL returned error: 404 Not Found - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user. [2] => 22 ) ) [3] => Array ( [file] => /Library/FileMaker Server/HTTPServer/htdocs/FileMaker/Implementation/FileMakerImpl.php [line] => 222 [function] => _execute [class] => FileMaker_Implementation [object] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://130.241.157.54:81 [recordClass] => FileMaker_Record [prevalidate] => [database] => BOxTax.fmp12 [username] => xxx [password] => xxxxxxxx ) [Vea4b3413] => [V9a3dcbce] => ) [type] => -> [args] => Array ( [0] => Array ( [-dbnames] => 1 ) ) ) [4] => Array ( [file] => /Library/FileMaker Server/HTTPServer/htdocs/FileMaker.php [line] => 398 [function] => listDatabases [class] => FileMaker_Implementation [object] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://130.241.157.54:81 [recordClass] => FileMaker_Record [prevalidate] => [database] => BOxTax.fmp12 [username] => xxx [password] => xxxxxxxx ) [Vea4b3413] => [V9a3dcbce] => ) [type] => -> [args] => Array ( ) ) [5] => Array ( [file] => /Library/FileMaker Server/HTTPServer/htdocs/fm_start.php [line] => 17 [function] => listDatabases [class] => FileMaker [object] => FileMaker Object ( [_impl] => FileMaker_Implementation Object ( [V73ee434e] => Array ( [charset] => UTF-8 [locale] => en [logLevel] => 3 [hostspec] => http://130.241.157.54:81 [recordClass] => FileMaker_Record [prevalidate] => [database] => BOxTax.fmp12 [username] => xxx [password] => xxxxxxxxx ) [Vea4b3413] => [V9a3dcbce] => ) ) [type] => -> [args] => Array ( ) ) [6] => Array ( [file] => /Library/FileMaker Server/HTTPServer/htdocs/classification.php [line] => 22 [args] => Array ( [0] => /Library/FileMaker Server/HTTPServer/htdocs/fm_start.php ) [function] => require_once ) ) [callback] => )

                     

                    Any help appreciated!

                     

                    Bengt

                     

                    • 7. Re: PHP memory issue?
                      BengtOxelman

                      I have been playing with the phptest.php file and by changing to the FindAnyCommand instead of FindAllCommand (1 record instead of 972), it work. So this IS a memory issue, silently crashing (at least with no error message indicating memory, e.g., "Fatal error: Call to undefined method FileMaker_Error::getRecords() in /Library/FileMaker Server/Web Publishing/web-server-support/test/fmi-test/phptestB.php on line 95". I have been playing around with cashes without success.

                       

                      But it is not the only problem. After restarting the two machines, the worker seem no longer get in contact with the master. But again, the error message is not very helpful.

                       

                      I am in big need for a solution to this problem, now.