There is such a call: ...

jQuery("#brenger-plugin-submit-form").click(function(){ var pick = jQuery("input[name=pickup-address-city]").val(); var dest = jQuery("input[name=delivery-location]").val(); if(pick == ""){ alert("Please enter pickup address in WP-Admin->Brenger API Settings"); } if(dest == ""){ jQuery("input[name=delivery-location]").css("border","1px solid red"); } if(pick != "" && dest != ""){ window.open('https://www.brenger.nl/nl?delivery_address[city]='+dest+'&pickup_address[city]='+pick); } }); 

... which, when launched from localhost, causes an error on the site www.brenger.nl Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 1171456 bytes) in /data/web/brenger/brenger.production-env.com/ htdocs2 / docroot / core / lib / Drupal / Core / Database / Statement.php on line 59 if the generated query is simply copied to the browser line, everything works. On the hosting also everything works great. Question: what's wrong with localhost?

apache2 2.4
ubuntu 17.04

 Mutex file:${APACHE_LOCK_DIR} default PidFile ${APACHE_PID_FILE} Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 5 User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP} HostnameLookups Off ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn IncludeOptional mods-enabled/*.load IncludeOptional mods-enabled/*.conf Include ports.conf <Directory /home/user/wpwork> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> AccessFileName .htaccess <FilesMatch "^\.ht"> Require all denied </FilesMatch> LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %O" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent IncludeOptional conf-enabled/*.conf IncludeOptional sites-enabled/*.conf <VirtualHost *:8011> ServerAdmin webmaster@localhost DocumentRoot /home/user/wpwork ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress 
  • Replace window.open with console.log and publish the resulting line - Anton Shchyrov
  • My code works as it is on Ubuntu 16.04 / Apache2 hosting. I want to solve the problem with the system. - vlad visitor
  • Well, whatever you want. My business is to suggest a direction in finding a solution. - Anton Shchyrov
  • Thank you for participating, the resulting line of the form brenger.nl ... ... works fine if you copy to the browser. - vlad visitor
  • Now replace your entire click handler with one line window.open('https://www.brenger.nl/nl?delivery_address[city]=Minderhout&pickup_address[city]=Amsterdam'); - Anton Shchyrov

2 answers 2

The brenger.nl site does not like localhost. Built something like this ... `

 <VirtualHost my.homelinux.com:80> ServerName my.homelinux.com DocumentRoot /home/user/wpwork/ ErrorLog "/var/log/apache2/error.my.homelinux.com.log" CustomLog "/var/log/apache2/access.my.homelinux.com.log" common <Directory /home/user/wpwork> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all Require all granted </Directory> </VirtualHost> 

... and began to work

    I will not give you a reason. But this maneuver should help:

    In PHP.ini, change the value of memory_limit = 128M; (as an example) in a big way.

    If this file cannot be changed, try to add in php_value memory_limit 128M : php_value memory_limit 128M (as an example)

    • I have no relation to the site brenger.nl, and I think that its admin is unlikely to do it for me) - vlad visitor
    • But anyway, thanks for participating - vlad visitor