# WordPress Dockerfile: Create container from official WordPress image, basic customizations.
# docker build -t wordpress_local:wp_custom_1.0 .
FROM wordpress:latest
# APT Update/Upgrade, then install packages we need
RUN apt update && \
apt upgrade -y && \
apt autoremove && \
First you install and do all things in blog.example.com and then continue with this instruction
Add this line to the blog.urge.ir
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ruleset name="Azibom Phpcs"> | |
<description> | |
I am Azibom and that is my custom phpcs.xml file | |
</description> | |
<file>./src</file> | |
<rule ref="Generic.Classes.DuplicateClassName"/> | |
<rule ref="Generic.CodeAnalysis.EmptyStatement"/> | |
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/> | |
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> |
php -i | grep "Loaded Configuration File"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/apt/sources.list.d/ | |
/etc/apt/sources.list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chown -R $USER:www-data storage; | |
sudo chown -R $USER:www-data bootstrap/cache; | |
chmod -R 775 storage; | |
chmod -R 775 bootstrap/cache; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com www.example.com; | |
location / { | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Server $host; |
What are PHP Namespaces?
Namespacing does for functions and classes what scope does for variables. It allows you to use the same function or class name in different parts of the same program without causing a name collision.
In simple terms, think of a namespace as a person's surname. If there are two people named "John" you can use their surnames to tell them apart.
NewerOlder