• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Use of Ajax under Jquery in PHP script

plane007

New Pleskian
I am running Plesk 11 under Ubuntu LTS 12.04.

I have PHP scripts that generate HTML that contains JQuery functions that use $.post with Fully Qualified Domain names as part of an absolute reference URL (e.g. http://www.domainname.com/phpscript.php) pointing at other PHP scripts in the same domain name as its host. These requests are ignored by the operatings system and the javascript continues to execute after the $.post command.

However, if I make the URL a relative reference (e.g. ./phpscript.php), then the $.post command works as expected.

I have discovered this effect in both Firefox and Chrome.

Regards,
Peter
 
The URLs are correct, since the same script (with FQDNs and http) runs correctly with exactly the same values with CPanel under CENTOS. In this case, the FQDN works.

I note that when I use the same script without Plesk, the error file defined by the php.ini file in the same directory as the php script is used to define the name of the error log file. However, when Plesk is running, the error log filoe name is generated by Plesk and NOT by the local php.ini. This runs counter to how PHP normally operates.
 
The URLs are correct, since the same script (with FQDNs and http) runs correctly with exactly the same values with CPanel under CENTOS. In this case, the FQDN works.

Such reasoning is invalid. You need to explicitly check whether your script generates proper values in a given environment.

I note that when I use the same script without Plesk, the error file defined by the php.ini file in the same directory as the php script is used to define the name of the error log file. ... This runs counter to how PHP normally operates.

PHP never works this way unless explicitly configured to do so. You could probably set desired error_log value via custom PHP settings in Panel.


Also, a hint: try switching off nginx service in Panel's Services Management. If this makes your script work, then answer to my first question is (unsurprisingly) "NO".
 
I had checked the values generated in the script, since these values are shown in "view source".

I have disabled the nginx reverse proxy and rebooted the server, still get the same effect. So the answer to your first question would appear to be yes.

I also find that if FQDNs are used in a <form>, rather than relative URLs, the form is submitted to the server without the GET or POST values! This is effectively a resubmission of the page. If I give a relative URL, then the form works.

In other words, it appears as if the reverse proxy is working when the setting is off.
 
Back
Top