logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache memory with php dll
Author
sailor



Joined: 17 Apr 2015
Posts: 82
Location: US

PostPosted: Tue 28 May '24 19:31    Post subject: Apache memory with php dll Reply with quote

I have a VMware vm with 4 Intel cpus at 2.2 ghz, Windows 2016, 12 gig of RAM, httpd is using 9 of them.

If I add more memory, will httpd consume that too? MySQL is local as well and is using 286 megabytes of RAM.

I never got around to changing to fcgi on my WordPress Windows vm's...
Back to top
Stray78



Joined: 15 Apr 2024
Posts: 20
Location: USA

PostPosted: Wed 29 May '24 4:13    Post subject: Reply with quote

9 GBs of memory? I Wish, I have 256 GB of memory and my httpd uses not even 1 GB. Rolling Eyes
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7334
Location: Germany, Next to Hamburg

PostPosted: Wed 29 May '24 9:13    Post subject: Re: Apache memory with php dll Reply with quote

sailor wrote:
I have a VMware VM with 4 Intel CPUs at 2.2 GHz, Windows 2016, and 12 gigs of RAM, httpd is using 9 of them.

If I add more memory, will httpd consume that too? MySQL is local as well and is using 286 megabytes of RAM.

I never got around to changing to fcgi on my WordPress Windows vm's...


It sounds like you have a memory leak in your PHP version.

Going to mod_fcgid is easy. Here is a working example for WordPress.

Code:

Define SRVROOT "/Users/jblond/Apache24"
Define WORKROOT "/Users/jblond/work/"
Define PHP82RC "C:\\php82"

<VirtualHost *:80>
   ServerName wp.local.apachehaus.de

   DirectoryIndex index.php

   <IfModule fcgid_module>
      FcgidInitialEnv PHPRC "${PHP82RC}"
      FcgidInitialEnv PATH "${PHP82RC};C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;"
      FcgidInitialEnv SystemRoot "C:\\Windows"
      FcgidInitialEnv SystemDrive "C:"
      FcgidInitialEnv TEMP "C:\\WINDOWS\\TEMP"
      FcgidInitialEnv TMP "C:\\WINDOWS\\TEMP"
      FcgidInitialEnv windir "C:\\WINDOWS"
      FcgidPassHeader Authorization
      <Files ~ "\.php$">
         Options Indexes FollowSymLinks ExecCGI
         AddHandler fcgid-script .php
         FcgidWrapper "C:/php82/php-cgi.exe" .php
      </Files>
   </IfModule>

   CustomLog "C:\Users\jblond\Apache24\logs\wp_access.log" common
   ErrorLog "C:\Users\jblond\Apache24\logs\wp_error.log"

   DocumentRoot "${WORKROOT}wp"
   <Directory "${WORKROOT}wp">
      Options Indexes FollowSymLinks
      AllowOverride None
      Require all granted
   </Directory>
</VirtualHost>


<Directory ${WORKROOT}wp>
        AddDefaultCharset UTF-8
        # BEGIN WordPress
        <IfModule mod_rewrite.c>
                RewriteEngine On
            RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|PUT|DELETE|FLURP|HEAD)
                RewriteRule .* - [R=405,L]
                RewriteCond %{HTTP_USER_AGENT}  ^.*python-requests.*$
                RewriteCond %{HTTP_USER_AGENT}  ^.*opensiteexplorer.*$
                RewriteRule . - [R=403,L]
                RewriteRule ^index\.php$ - [L]
                # add a trailing slash to /wp-admin
                RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
                RewriteCond %{REQUEST_FILENAME} -f [OR]
                RewriteCond %{REQUEST_FILENAME} -d
                RewriteRule ^ - [L]
                RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
                RewriteRule ^(.*\.php)$ $1 [L]
                RewriteRule . index.php [L]
        </IfModule>
        # END WordPress
</Directory>


Last edited by James Blond on Fri 31 May '24 15:03; edited 1 time in total
Back to top
puertoblack2003



Joined: 31 Jul 2009
Posts: 121
Location: U.S

PostPosted: Wed 29 May '24 16:08    Post subject: Re: Apache memory with php dll Reply with quote

Hi @jamesblond just a question you have 2 instance of PHP8.2RC and 1 instance of PHP80.Is that a typo?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7334
Location: Germany, Next to Hamburg

PostPosted: Fri 31 May '24 15:03    Post subject: Re: Apache memory with php dll Reply with quote

puertoblack2003 wrote:
Hi @jamesblond just a question you have 2 instance of PHP8.2RC and 1 instance of PHP80.Is that a typo?


nope, not a typo. The first one sets "PHPRC" aka the location of the php.ini file. The second one add the PHP installation path to the PATH variable.

The FcgidWrapper "C:/php80/php-cgi.exe" .php should be FcgidWrapper "C:/php82/php-cgi.exe" .php. it is a typo. I corrected that. Thanks fo the hint.
Back to top
Otomatic



Joined: 01 Sep 2011
Posts: 184
Location: Paris, France, EU

PostPosted: Fri 31 May '24 16:22    Post subject: Reply with quote

Hi,

To use FCGI mode with Wampserver, I proceed a little differently.

Different versions of php are installed in ${INSTALL_DIR}/bin/php/ for example:
e:\wamp64\bin\php\php7.4.33\
e:\wamp64\bin\php\php8.0.30\
e:\wamp64\bin\php\php8.1.28\
e:\wamp64\bin\php\php8.2.13\
e:\wamp64\bin\php\php8.2.19\
e:\wamp64\bin\php\php8.3.7\

In httpd.conf file:
Code:

...
# Where Wampserver is installed
Define INSTALL_DIR E:/wamp64
...
LoadModule fcgid_module modules/mod_fcgid.so
...
<IfModule fcgid_module>
  FcgidMaxProcessesPerClass 300
  FcgidConnectTimeout 10
  FcgidProcessLifeTime 0
  FcgidMaxRequestsPerProcess 0
  FcgidMinProcessesPerClass 0
  FcgidFixPathinfo 0
  FcgidZombieScanInterval 20
  FcgidMaxRequestLen 536870912
  FcgidIOTimeout 120
  FcgidTimeScore 3
  FcgidPassHeader Authorization
  Define PHPROOT ${INSTALL_DIR}/bin/php/php
</IfModule>


In the httpd-vhosts.conf file, for a VirtualHost:
Code:
<VirtualHost *:80>
  ServerName mylocalsite
  DocumentRoot "mydirectory"
  <Directory  "mydirectory/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
  <IfModule fcgid_module>
    Define FCGIPHPVERSION "7.4.33"
    FcgidInitialEnv PHPRC ${PHPROOT}${FCGIPHPVERSION}
    <Files ~ "\.php$">
      Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
      AddHandler fcgid-script .php
      FcgidWrapper "${PHPROOT}${FCGIPHPVERSION}/php-cgi.exe" .php
    </Files>
  </IfModule>
</VirtualHost>

This makes it very easy to change the PHP version to be used for a VirtualHost, and to use different versions of PHP for different VirtualHosts.
Back to top


Reply to topic   Topic: Apache memory with php dll View previous topic :: View next topic
Post new topic   Forum Index -> Apache