https://item.taobao.com/item.htm?_u=ibuhab0bb1b&id=628418040642&spm=a1z09.2.0.0.76e02e8dYbXP6k
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}
香港花太多時間係用玩具去吸引學生學編程,但無提升到對編程概念嘅表達,其實所有人都應該明白,如果係鐘意寫Program嘅小朋友,絕大部份第一次接觸就會愛上,其實係唔存在你要買好多玩具俾佢試先會所謂「啓發」到佢地嘅興趣。而個社會咁做不外乎得以下幾種可能
- 我係𡃁仔都不停叫阿媽買不同玩具玩啦,無接觸過編程嘅父母唔明白呢個道理所以不停買
- 因為賣玩具係一個賺錢嘅行業,而代理玩具黎香港賣亦都唔洗好有知識,自古以來香港係做左手交右手嘅生意,所以教育玩具業好發達。但真正對教育有研究嘅公司近乎無
- 老師要有舊見得到嘅野同校長交代,所以對接高編程技巧唔係首要,唔買舊玩具返黎又點有野睇呢,所以玩具業發達
上面三個原因互為影響互相加強,所以教育展變教育玩具展。
對香港嘅影響:
大家都係做代理唔研發,而大粒佬係呢啲展到都係得講野兩個字亦都唔會研發,最終後果就係香港洗好多錢係教育到最尾得個殼,香港人可以話俾外國人知香港投資左好多錢落教育,買左好多光鮮嘅玩具,除此之外乜都無。香港唔洗諗會出到Basic之父或者Logo之父等等一系列用實際行動去壓低學習難度嘅教育家,香港人唔洗諗,所以我地要以行動作出改變。
教育展中嘅清泉:
呢間公司做到好Deep,成套教學工具自己出,老細寫左本ROS嘅書有自己嘅學習思想,相信佢係用自己學習ROS嘅學習經驗濃縮出黎
This function is using SharePoint-Java-API library.
If your c# azure functions project in visual studio has error : “There is no Functions runtime available that matches the version specified in the project.”. Do this :
Click : Download & Install
Run this command in windows host
netsh interface portproxy add v4tov4 listenport=22 listenaddress=0.0.0.0 connectport=22 connectaddress=<wsl ubuntu ip>
To enable debug, “CFLAGS=-g ./configure” won’t work, edit ./isa/Makefile and add -g to variable RISCV_GCC_OPTS then it works.
The dump file won’t show debug info, run “riscv64-unknown-elf-objdump -DS rv64ui-v-addi” then you see it
The technique they have used are “trait“, “magic function” and “call_user_func_array“. The whole thing work in runtime, not compile time.
1. Php trait
PHP trait is just like copy and paste the code from trait into the injected class.
2. Magic function
When calling a not exist function, the __call function will be called. Laravel is using library Macroable, so in the code, when you are calling a non exist function on an object, the __call will be called and try to call the real function by call_user_func_array
this problem happens in both mac and ubuntu
/home/peter/workspace/riscv-tests/benchmarks/dhrystone/dhrystone.c:20:1: error: return type defaults to ‘int’ [-Wimplicit-int]
Fixed is here https://github.com/riscv-software-src/riscv-tests/compare/master…pratikkedar:riscv-tests:pratik-test
Total page | Total article | Editorial (no of page) | Longest article (no of page) | Advertisement (no of page) | |
2024 Nov Dec | 76 | 11 | 1 | 14 | 5 |
2024 Sep Oct | 76 | 12 | 1 | 25 | 8 |
if you meet this problem: fatal: the remote end hung up unexpectedly
Do this:
git config --global http.postBuffer 157286400
This book is totally outdated because the official facebook PHP SDK is already deprecated. Now we should go for facebook javascript SDK
「代碼脫亞入歐」這一概念可以從幾個方面來理解,特別是在香港的編程界與日本的明治維新之間進行比較。
1. 歷史背景
- 明治維新:日本在19世紀中期至20世紀初的這場運動,旨在現代化國家,學習西方的技術和制度,從而提升國際競爭力。
- 香港編程界:香港的科技和編程文化需要吸收更多的國際元素,特別是西方先進的技術和創新思維。
2. 技術與創新
- 學習與引進:香港的程序員可以借鑒日本在技術引進和創新方面的成功經驗,積極學習全球最新的編程語言、開發工具和框架。
- 開源文化:推動開源項目和社區的發展,學習如何在全球範圍內合作和交流。
3. 教育與培訓
- 強化教育體系:借鑒日本的教育模式,提升編程教育的質量,例如加強STEM(科學、技術、工程和數學)教育。
- 實踐與實驗:鼓勵學生參加實習和實驗項目,增強實際操作能力。
4. 政策支持
- 政府角色:香港政府可以效仿日本的政策,創造良好的創新環境,支持初創企業和技術發展。
- 資金與投資:提供資助和資源,吸引更多國際企業和人才。
5. 文化與思維轉變
- 全球視野:推動編程文化向國際化轉型,培養開放和包容的心態。
- 創新思維:鼓勵創新和實驗,推動跨界合作,促進多元化的思維方式。
總結來說,「代碼脫亞入歐」不僅是技術上的轉型,更是一種思維方式和文化的變革。香港的編程界若能學習日本明治維新的經驗,將能在全球化的浪潮中更好地立足與發展。
This will select value in hex format, beware the bit width, otherwise it wrap to zero
SELECT SEQUENCE, RAWTOHEX(CAST(pc AS BINARY(8))), line FROM QUANTR ORDER BY SEQUENCE
1. 時間係亂序執行,否則佛教不能自圓其說。只要亂序執行講得通,佛教整套哲學體系就會自己渝合。而家佛教哲學有幾個不能接合嘅地方,第一就係講所有野係空,但又因緣生。第二就係佛教嘅神通如果係真,根本容唔落係自己套哲學體系裏面。就算講得最清楚嘅龍樹,都只不過係話當「果」出現時,「因」先會被確定。如果時間係線性,呢單野根本完全唔合理,但如果時間就亂序執行,咁就好正確。因為係呢一對事物「因」+「果」佢地嘅時間當然係順序執行,但跳出左呢一對事物,佢地嘅時間線就唔係,所以係佢地時間線黎講果要出現左,因先可以成立。企左出去佢地嘅時間線,其實係果先出現,再到因。我再舉多個你地可以睇到嘅例子。int x; x=123. 呢兩句code,你地用verilator synthesis出logic gate,係呢兩句code嘅時間線上先有int x,先可以有x=123. 但其實係int x之前,係另一條時間線,x已經存在,所以果出現時,姐係int x出現時,佢個因x先被確立。乎合龍樹所講嘅野。古人因為科技所限,無法舉證。
2. 時間係唔係線性,而亂序執行唔會阻擋世情嘅出現。我地感受到時間係線性,因為只係我地要靠時間去圍持呢個身體同識。舉個實制例子,CPU係亂序執行,但被執行嘅program會以為自己嘅時間線係線性,但其實唔係。只係CPU唔會張下一句指令嘅執行結果話比上一句嘅指令知,最終令到program以為自己條時間線有如河流一樣線性。
parted
resizepart 3
-0
quit
pvs
pvresize /dev/sda3
lvextend -l+100%FREE /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/ubuntu-vg/ubuntu-lv
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)’))’: /simple/matplotlib/
python -m pip install something --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org
ls -tr|head -50|while read a; do echo $a; rm -fr $a/node_modules; done
https://www.accu.co.uk/p/117-iso-metric-thread-dimensions
Bolt Sizes Chart & Metric Bolt Dimensions
THREAD SIZE | MAJOR DIAMETER (MM) | MINOR DIAMETER (MM) | THREAD PITCH (MM) | PITCH DIAMETER (MM) | TAPPING DRILL DIAMETER (MM) | CLEARANCE HOLE DIAMETER (MM) |
---|---|---|---|---|---|---|
M1 | 1.0 | 0.729 | 0.25 | 0.838 | 0.75 | 1.3 |
M1.1 | 1.1 | 0.829 | 0.25 | 0.938 | 0.85 | 1.4 |
M1.2 | 1.2 | 0.929 | 0.25 | 1.038 | 0.95 | 1.5 |
M1.4 | 1.4 | 1.075 | 0.30 | 1.205 | 1.10 | 1.8 |
M1.6 | 1.6 | 1.221 | 0.35 | 1.373 | 1.25 | 2.0 |
M1.8 | 1.8 | 1.421 | 0.35 | 1.573 | 1.45 | 2.3 |
M2 | 2.0 | 1.567 | 0.40 | 1.740 | 1.60 | 2.6 |
M2.2 | 2.2 | 1.713 | 0.45 | 1.908 | 1.75 | 2.9 |
M2.5 | 2.5 | 2.013 | 0.45 | 2.208 | 2.05 | 3.1 |
M3 | 3.0 | 2.459 | 0.50 | 2.675 | 2.50 | 3.6 |
M3.5 | 3.5 | 2.850 | 0.60 | 3.110 | 2.90 | 4.2 |
M4 | 4.0 | 3.242 | 0.70 | 3.545 | 3.30 | 4.8 |
M4.5 | 4.5 | 3.688 | 0.75 | 4.013 | 3.80 | 5.3 |
M5 | 5.0 | 4.134 | 0.80 | 4.480 | 4.20 | 5.8 |
M6 | 6.0 | 4.917 | 1.00 | 5.350 | 5.00 | 7.0 |
M7 | 7.0 | 5.917 | 1.00 | 6.350 | 6.00 | 8.0 |
M8 | 8.0 | 6.647 | 1.25 | 7.188 | 6.80 | 10.0 |
M9 | 9.0 | 7.647 | 1.25 | 8.188 | 7.80 | 11.0 |
M10 | 10.0 | 8.376 | 1.50 | 9.026 | 8.50 | 12.0 |
M11 | 11.0 | 9.376 | 1.50 | 10.026 | 9.50 | 13.5 |
M12 | 12.0 | 10.106 | 1.75 | 10.863 | 10.20 | 15.0 |
M14 | 14.0 | 11.835 | 2.00 | 12.701 | 12.00 | 17.0 |
M16 | 16.0 | 13.835 | 2.00 | 14.701 | 14.00 | 19.0 |
M18 | 18.0 | 15.394 | 2.50 | 16.376 | 15.50 | 22.0 |
M20 | 20.0 | 17.294 | 2.50 | 18.376 | 17.50 | 24.0 |
M22 | 22.0 | 19.294 | 2.50 | 20.376 | 19.50 | 26.0 |
M24 | 24.0 | 20.752 | 3.00 | 22.051 | 21.00 | 28.0 |
M27 | 27.0 | 23.752 | 3.00 | 25.051 | 24.00 | 33.0 |
M30 | 30.0 | 26.211 | 3.50 | 27.727 | 26.50 | 35.0 |
M33 | 33.0 | 29.211 | 3.50 | 30.727 | 29.50 | 38 |
M36 | 36.0 | 31.670 | 4.00 | 33.402 | 32.00 | 41 |
M39 | 39.0 | 34.670 | 4.00 | 36.402 | 35.00 | 44 |
M42 | 42.0 | 37.129 | 4.50 | 39.077 | 37.50 | 47 |
M45 | 45.0 | 40.129 | 4.50 | 42.077 | 40.50 | 50 |
M48 | 48.0 | 42.857 | 5.00 | 44.752 | 43.00 | 53 |
M52 | 52.0 | 46.587 | 5.00 | 48.752 | 47.00 | 57 |
M56 | 56.0 | 50.046 | 5.50 | 52.428 | 50.50 | 61 |
M60 | 60.0 | 54.046 | 5.50 | 56.428 | 54.50 | 65 |
M64 | 64.0 | 57.505 | 6.00 | 60.103 | 58.00 | 69 |
M68 | 68.0 | 61.505 | 6.00 | 64.103 | 62.00 | 73 |
165 23.534334 192.168.10.115 218.255.142.226 DNS 70 Standard query 0x1644 A quantr.com
0000 b4 75 0e 66 6c f2 78 4f 43 9c 8c 15 08 00 45 00 .u.fl.xOC.....E.
0010 00 38 67 33 00 00 40 11 de 84 c0 a8 0a 73 da ff [email protected]..
0020 8e e2 ff e6 00 35 00 24 86 8b 16 44 01 00 00 01 .....5.$...D....
0030 00 00 00 00 00 00 06 71 75 61 6e 74 72 03 63 6f .......quantr.co
0040 6d 00 00 01 00 01 m.....
166 23.538999 218.255.142.226 192.168.10.115 DNS 86 Standard query response 0x1644 A quantr.com A 218.255.142.226
0000 78 4f 43 9c 8c 15 b4 75 0e 66 6c f2 08 00 45 00 xOC....u.fl...E.
0010 00 48 3a cf 00 00 37 11 13 d9 da ff 8e e2 c0 a8 .H:...7.........
0020 0a 73 00 35 ff e6 00 34 86 f3 16 44 85 00 00 01 .s.5...4...D....
0030 00 01 00 00 00 00 06 71 75 61 6e 74 72 03 63 6f .......quantr.co
0040 6d 00 00 01 00 01 c0 0c 00 01 00 01 00 01 51 80 m.............Q.
0050 00 04 da ff 8e e2 ......
This code run a standalone ApacheDS server, you can use ApacheDS studio to connect to it, it host localhost:10389
package hk.quantr.apachedsembeddedserver;
import java.io.File;
import java.io.IOException;
import java.util.List;
import org.apache.directory.api.ldap.model.constants.SchemaConstants;
import org.apache.directory.api.ldap.model.schema.LdapComparator;
import org.apache.directory.api.ldap.model.schema.comparators.NormalizingComparator;
import org.apache.directory.api.ldap.model.schema.registries.ComparatorRegistry;
import org.apache.directory.api.ldap.model.schema.registries.SchemaLoader;
import org.apache.directory.api.ldap.schema.extractor.SchemaLdifExtractor;
import org.apache.directory.api.ldap.schema.extractor.impl.DefaultSchemaLdifExtractor;
import org.apache.directory.api.ldap.schema.loader.LdifSchemaLoader;
import org.apache.directory.api.ldap.schema.manager.impl.DefaultSchemaManager;
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.DefaultDirectoryService;
import org.apache.directory.server.core.api.InstanceLayout;
import org.apache.directory.server.core.api.partition.Partition;
import org.apache.directory.server.core.api.schema.SchemaPartition;
import org.apache.directory.server.core.factory.JdbmPartitionFactory;
import org.apache.directory.server.core.partition.ldif.LdifPartition;
import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.protocol.shared.transport.TcpTransport;
import org.apache.directory.server.protocol.shared.transport.Transport;
/**
*
* @author Peter <[email protected]>
*/
public class ApacheDSEmbeddedServer {
public static void main(String[] args) throws ClassNotFoundException, Exception {
DefaultDirectoryService directoryService = new DefaultDirectoryService();
File workingDirector = new File("working_dir");
InstanceLayout instanceLayout = new InstanceLayout(workingDirector);
directoryService.setInstanceLayout(instanceLayout);
File schemaRepository = new File(workingDirector.getName(), "schema");
SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(workingDirector);
try {
extractor.extractOrCopy();
} catch (IOException ioe) {
// The schema has already been extracted, bypass
}
SchemaLoader loader = new LdifSchemaLoader(schemaRepository);
DefaultSchemaManager schemaManager = new DefaultSchemaManager(loader);
schemaManager.loadAllEnabled();
ComparatorRegistry comparatorRegistry = schemaManager.getComparatorRegistry();
for (LdapComparator<?> comparator : comparatorRegistry) {
if (comparator instanceof NormalizingComparator) {
((NormalizingComparator) comparator).setOnServer();
}
}
directoryService.setSchemaManager(schemaManager);
// Init the schema partation
LdifPartition ldifPartition = new LdifPartition(schemaManager, directoryService.getDnFactory());
ldifPartition.setPartitionPath(new File(workingDirector.getName(), "schema").toURI());
SchemaPartition schemaPartition = new SchemaPartition(schemaManager);
schemaPartition.setWrappedPartition(ldifPartition);
directoryService.setSchemaPartition(schemaPartition);
List<Throwable> errors = schemaManager.getErrors();
// Inject the System Partition
JdbmPartitionFactory partitionFactory = new JdbmPartitionFactory();
Partition systemPartition = partitionFactory.createPartition(directoryService.getSchemaManager(), directoryService.getDnFactory(), "system", ServerDNConstants.SYSTEM_DN, 500, new File(directoryService.getInstanceLayout().getPartitionsDirectory(), "system"));
systemPartition.setSchemaManager(directoryService.getSchemaManager());
partitionFactory.addIndex(systemPartition, SchemaConstants.OBJECT_CLASS_AT, 100);
directoryService.setSystemPartition(systemPartition);
// schemaManager.loadAllEnabled();
// SchemaPartition schemaPartition = new SchemaPartition(schemaManager);
// directoryService.setSchemaPartition(schemaPartition);
LdapServer ldapServer = new LdapServer();
ldapServer.setDirectoryService(directoryService);
ldapServer.setServiceName("DefaultLDAP");
Transport ldap = new TcpTransport("0.0.0.0", 10389, 3, 5);
ldapServer.addTransports(ldap);
// LdifFileLoader ldifLoader = new LdifFileLoader(directoryService.getAdminSession(), "users.ldif");
// ldifLoader.execute();
directoryService.startup();
ldapServer.start();
}
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>hk.quantr</groupId>
<artifactId>ApacheDSEmbeddedServer</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>ApacheDS Embedded Server</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<exec.mainClass>hk.quantr.apachedsembeddedserver.ApacheDSEmbeddedServer</exec.mainClass>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-all</artifactId>
<version>2.0.0.AM27</version>
</dependency>
</dependencies>
</project>
Then you can connect it by ApacheDS Studio
Set to a better font size
- download jetbrain font https://www.jetbrains.com/lp/mono/ , unzip it, click to all ttf file to install the fonts
- restart netbeans
- set it
4. Set the color
When i change kernelvec.S to -ggdb, my dwarf library broken but now fixed. Commit :e640c3d9
And I still don’t understand why .S won’t be an compile unit in dwarf, why design like that.
File elf = new File(cmd.getOptionValue("i").replaceFirst("^~", System.getProperty("user.home")));
System.out.println(elf.getAbsolutePath());
final ArrayList<Dwarf> dwarfArrayList = DwarfLib.init(elf, 0, false);
long address = 0x8000002al;
List<VariableWithAddress> variableWithAddresses = new ArrayList<VariableWithAddress>();
CompileUnit cu = DwarfLib.getCompileUnit(dwarfArrayList, address);
for (DwarfLine line : cu.dwarfDebugLineHeader.lines) {
if (line.address.compareTo(BigInteger.valueOf(address)) < 0) {
continue;
}
// System.out.println(line.file_num + " = " + cu.dwarfDebugLineHeader.filenames.get((int) line.file_num).file.getAbsolutePath() + "\t" + line);
VariableWithAddress variableWithAddress = new VariableWithAddress();
variableWithAddress.file_num = line.file_num;
variableWithAddress.line_num = line.line_num;
variableWithAddress.address = line.address;
variableWithAddresses.add(variableWithAddress);
}
for (DebugInfoEntry debugInfoEntry : cu.debugInfoEntries) {
for (DebugInfoEntry debugInfoEntry2 : debugInfoEntry.debugInfoEntries) {
if (debugInfoEntry2.name.equals("DW_TAG_variable")) {
} else if (debugInfoEntry2.name.equals("DW_TAG_subprogram")) {
for (DebugInfoEntry debugInfoEntry3 : debugInfoEntry2.debugInfoEntries) {
if (debugInfoEntry3.name.equals("DW_TAG_variable")) {
try {
// System.out.println("\t\t\t\t" + debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_name"));
// System.out.println("\t\t\t\t" + debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_decl_file"));
// System.out.println("\t\t\t\tclass=" + debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_decl_line"));
// System.out.println("\t\t\t\tclass=" + debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_decl_line").value.getClass());
int lineNo;
if (debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_decl_line").form == Definition.DW_FORM_data1) {
lineNo = Integer.parseInt(debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_decl_line").value.toString());
} else {
lineNo = Integer.parseInt(debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_decl_line").value.toString(), 16);
}
int colNo = Integer.parseInt(debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_decl_column").value.toString());
int fileNo = (int) debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_decl_file").value;
List<VariableWithAddress> result = variableWithAddresses.stream().filter(a -> a.file_num == fileNo).collect(Collectors.toList());
boolean check = false;
if (result.get(0).line_num <= lineNo && lineNo <= result.get(result.size() - 1).line_num) {
check = true;
}
if (!check) {
return;
}
String filePath = cu.dwarfDebugLineHeader.filenames.get((int) fileNo).file.getAbsolutePath();
List<String> lines = FileUtils.readLines(new File(filePath), Charset.defaultCharset());
System.out.printf("%x %s:%d \t= %s, %s\n", address, filePath, lineNo, debugInfoEntry3.debugInfoAbbrevEntries.get("DW_AT_name").value, lines.get(fileNo));
} catch (IOException ex) {
Logger.getLogger(QemuLogToMap.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
}
}
I need a super clean apache and forward all PHP requests to a independent php-cgi process which host by a specific port
1. Install Apache
Mac
In ubuntu, no need to build apache from source, just “sudo apt-get install apache2”
git clone https://github.com/apache/apr.git
cd apr
./buildconf
./configure --prefix=/Users/peter/Downloads/apr-install
make -j
make install
git clone https://github.com/apache/httpd.git
cd httpd
./configure --prefix=/Users/peter/Downloads/apache-install --with-apr=/Users/peter/Downloads/apr-install
make -j
make install
Linux
git clone https://github.com/apache/httpd.git
cd httpd
./buildconf
./configure --prefix=/home/peter/Downloads/apache-install
make -j
make install
2. Install PHP
Mac
git clone https://github.com/php/php-src.git
./buildconf
./configure --prefix=/Users/peter/Downloads/php-install --with-openssl --with-iconv=$(brew --prefix libiconv) --with-zlib --with-mysqli
make -j
make install
Linux
git clone https://github.com/php/php-src.git
./buildconf
./configure --with-openssl --with-mysqli --with-zlib --prefix=/home/peter/Downloads/php-install
make -j
make install
if you meet this error “configure: error: re2c 1.0.3 or newer is required to generate PHP lexers.”, do “sudo apt-get install re2c”
3. Setup Apache
- sudo apt-get install apache2
- sudo a2enmod proxy_http
- edit “/etc/apache2/mods-available/proxy.load”, add “LoadModule proxy_fcgi_module /usr/lib/apache2/modules/mod_proxy_fcgi.so”
- edit “/etc/apache2/sites-enabled/000-default.conf”, add these
- edit “/home/peter/Downloads/apache-install/conf/httpd.conf”
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
<Files ~ "\.(php|phtml)$">
SetHandler "proxy:fcgi://127.0.0.1:1992//./"
ProxyFCGIBackendType GENERIC
</Files>
- Enable these
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
4. Run
/home/peter/Downloads/php-install/bin/php-cgi -b 1992
5. If you see this WordPress error, add this to debug
ob_flush();
ob_start();
var_dump($error);
$message = __( '3. There has been a critical error on this website.<pre>'.ob_get_flush().'</pre>');
6. Memory exhausted
add “memory_limit = 1020M” to php.ini
7. If you see this Phpmyadmin error, do this
Edit /Users/peter/Downloads/php-install/lib/php.ini, add “output_buffering = 100M”
If you see this error, do these
Edit /Users/peter/Downloads/php-install/lib/php.ini, add “mysqli.default_socket = /var/run/mysqld/mysqld.sock”
If you see “Getting error mysqli::real_connect(): (HY000/2002): No such file or directory”, do these
Change localhost to 127.0.0.1 in config.inc.php
$cfg['Servers'][$i]['host'] = '127.0.0.1';
Use tcpdump to capture fast-cgi packages
sudo tcpdump -i any -nn -Xx port 1992 <-- dump hex
sudo tcpdump -i any -nn -A port 1992 <-- dump ascii
Using wireshark to capture fastcgi
tcp.port eq 1992 and tcp.len>100