Lookup Field on Hosting Server (v2019)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
shahparzsoft
User
Posts: 361

Lookup Field on Hosting Server (v2019)

Post by shahparzsoft »

A phpmaker Version 2019 generated script which is working accurately on local server
is not working on web hosting.

for example i applied a simple lookup on a field for customer name, which is successfully lookup customers
on local machine but not working on hosting server.

Even connections are OK in ewcfg*.php file.

Can u please guide any hint


arbei
User
Posts: 9401

Post by arbei »

  • Make sure you have uploaded the "api" folder.
  • Make sure the table an field names in the database on your production are same as those on your local server (including letter case). (Linux server is case-sensitive.)
  • You may press F12 in your browser, go to the Network panel to check HTTP response from the API (which may contain error message). (Make sure you enable "Debug" in ewcfg*.php.)

shahparzsoft
User
Posts: 361

Post by shahparzsoft »

I don't know what's happening. i have installed Version 2020.0.2 and having same issue when copied on hosting server.

All lookup values gone when copied on hosting server. When press F12 having following error:

mycompany.com/api/index.php?q=%25&n=20&rnd=100306&action=lookup

with this line: Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Please help out.


arbei
User
Posts: 9401

Post by arbei »

  • arbei wrote:

Make sure you enable "Debug" in ewcfg*.php.


shahparzsoft
User
Posts: 361

Post by shahparzsoft »

After investigating i opened the folder of API in which i opened error.log file.
In that error log file following error was occurring:

#3 {main}
thrown in /home2/shafinancial/public_html/demo2020/vendor/slim/slim/Slim/App.php on line 621

in App.php line 621
i removed following lines:

        if (ob_get_length() > 0) {
            throw new RuntimeException("Unexpected data in output buffer. " .
                "Maybe you have characters before an opening <?php tag?");
        }

after removing above if condition, everything is working fine.

Can u tell me what the above if condition is work for and why it is creating trouble ?

Thanks for your patience and reply.


arbei
User
Posts: 9401

Post by arbei »

You should not remove it which ensure nothing is outputted before the actual result is returned. As the error message says:
Maybe you have characters before an opening <?php tag?

Maybe you have whitespaces before the PHP tag, maybe you have outputted something in some global server event (e.g. Page_Loading), you should check your code.


shahparzsoft
User
Posts: 361

Post by shahparzsoft »

arbei wrote:
Maybe you have whitespaces before the PHP tag, maybe you have outputted something
in some global server event (e.g. Page_Loading), you should check your code.

although the above can be possible in my generated script. But i also uploaded the demo project,
which was also creating the same issue.


arbei
User
Posts: 9401

Post by arbei »

You may view uploaded scripts on your server to check if spaces are inserted. If so, you should check your FTP client and change the transfer type to "Binary".


Post Reply