Some of the Apache modules are related to programming languages, like mod_php and mod_python. The description is basically "enables usage of php within apache" or "enables usage of python within apache". I'm trying to understand an overview of how these types of "language" modules work.
How do mod_php, mod_python, mod_Language work
722 views Asked by sameold AtThere are 2 answers
Kalle
On
This is relatively simple; When the webserver starts, it will register modules within its core. Language interpreter modules, like mod_php, will register a hook within the page request handler.
This means when a user requests a page, the webserver will pass the request to the module, which checks if the requested file is a type that is registered to be executed by the parser behind the module. In PHP's case you are most likely adding "AddType application/x-httpd-php .php" or similar to the httpd.conf file, which mod_php, will take into account when parsing such requests.
PHP is now in control of the request, which will read the file, parse, compile and execute it and then return it to the request buffer which the webserver will serve as content.
Same goes for other modules, although their handling of a request is different, they all do the same thing.
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in APACHE
- .htaccess redirect 403 error files to 404 error document
- RestApi server code is not workinng
- Convert Apache VirtualHost to nginx Server Block for Dynamic Subdomains
- Looking the Method that MANUALLY INSTALL PHP on OSX Yosemite
- Premature end of script on VPS
- Rasterization with Javascript looks different on Apache server
- Vagrant - Ansible error installing Apache
- Can't use subdomain in Chrome using Apache (XAMPP)
- Django webapp (on an Apache2 server) hangs indefintely when importing nltk in views.py
- Redirect keystone app to sub directory using htaccess
- How can I integrate Solr5.1.0 with Nutch1.10
- Disconnect Client connected to cgi application
- Solr ping taking time during full import
- How to redirect an incoming request to specific serverName to different server in apache2?
- What is the correct way to link Django Flatpages?
Related Questions in MOD-PYTHON
- Mod_python not getting GET variables
- using python to filter requests in apache
- URLs in mod_python Not Working as Expected
- Making Python scripts work on MAMP
- XP with C:\python in path won't run files in C:\python
- Killing individual Apache processes in mod_python
- Ubuntu access rights - Mod_Python Permission denied
- mod_python equivalent to php exec() command
- Creating 4 mutexes based on 50 max processes, poor configuration?
- easiest way for inline python with apache (mod_python)?
- How to use non utf-8 input in mod_python python version 2
- Set http response Content-Type to "xml" in python
- deploying a WSGI application on mod_python
- How to change HTML form with 2 selections to Javascript?
- np.histogram outputs?? - Python
Related Questions in MOD-PHP
- PHP can't use 300MB of RAM
- PHP code is shown in browser as plain-text and not processed
- Using spdy with mod_php
- Limit of log line written to Apache Errorlog from mod php error_log
- Run background process from PHP on FastCGI
- htaccess - detect mod_php
- Detecting Whether or not fastCGI is running on a remote server
- Failing to install libapache2-mod-php5 on debian
- Centos 6.7 install PHP module for Apache
- Increase upload_max_filesize as a standalone setting just for phpmyadmin using php-fpm
- How do mod_php, mod_python, mod_Language work
- iconv utf-8 to ascii transliteration in mod_php/apache2
- Conditional .htaccess based on apache server API
- Installing libapache2-mod-php7.1
- Does mod_php honor HEAD requests properly?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Basically, if you install and configure mod_php correctls, a php file inside an apache DirectoryRoot will be executed. Mod_python works similarly.
If you install apache without mod_php and you have foo.php at the root of your htdocs folder then http://yourdomain/foo.php will treat the document as a plain text file. Installing and configuring mod_php will cause the script to be parsed as a php script, and the output to be sent to the browser as opposed to the raw text..
Justin