Example of coexistence of PHP3 and PHP4_PHP tutorial
The author has been debugging programs in the php3 environment. Later, after switching to php4, I felt that there were many problems.
Mainly because some programs that used to run normally under php3 suddenly discovered that there were a lot of problems under php4.
But when the program originally used in php4 moved to php3, it said that the xx function was not defined or that the syntax of a certain function was incomplete. Then I suddenly thought: Can I install both? It's also a good idea to test the compatibility of the program with both.
The installation and instruction document of php4/3 that the author refers to does not specify the method. It probably only says that the two can achieve coexistence through the --enable-versioning command and DSO mode. So what kind of DSO is it? After the author repeatedly thought about the installation and configuration practices for n times, I finally successfully installed both into the same web server. All .php3 files are parsed by php3, and .php files are parsed by php4.
Principle of implementation:
To achieve the coexistence of two different versions of parsers, the enable-versioning directive must be used. When should it be used? This depends on which version of the parser is installed later, so this command only needs to be used during subsequent installations. That is to say, if you install php4 first (as is the case in this example) and then php3, then you must add the enable-versioning directive when configuring php3. The reverse is also true.
The following are the installation and configuration steps:
1. Considering that the author's own system is installed with php4 and uses static mode, so if you want to use DSO, you can only It is adopted by php3. But when is enable-versioning added? Since there is no clear explanation in the document, I can only test it myself. I won’t go into details here about the configuration instructions for installing apache.
2. First compile and install php4 in a static way. The main instructions are as follows:
./configure --with-mysql=/www/mysql --with-apache= ../apache_1.3.12
> --enable-track-vars
3. Note: After compiling and installing php4, you must first install apache, otherwise install and install in DSO mode in the next step There is no way to use apxs script when compiling php3. And what should be noted!!!! is that when configuring apache, you must add the --enable-shared=max directive (that is, use the dso method) and then compile and install apache.
4. Finally, configure and compile php3. After decompression, run:
./configure --with-mysql=/www/mysql --with-apxs=/www/httpd/bin/apxs
> --enable-versioning
make
make install
Under normal circumstances, there is basically no problem.
If the reader is using an older php4 such as php4rc1, it may appear that the contents of the php4rc1 directory are not compiled but only the contents of the php3 directory are compiled during compilation. Then a solution is to change the directory of php4rc1 after compiling php4. Name, that's fine.
Test: Generally, as long as the compilation and installation pass smoothly, you only need to modify the settings of php3 and php4 in httpd.conf, and then restart apache.
Create two files test.php and test.php3 in the htdocs directory. Under normal circumstances, calling test.php will display the content of php4 and calling test.php3 will display the content of php3.
The content of test.php/test.php3 is as follows:
phpinfo();

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

C++ multi-thread debugging can use GDB: 1. Enable debugging information compilation; 2. Set breakpoints; 3. Use infothreads to view threads; 4. Use thread to switch threads; 5. Use next, stepi, and locals to debug. Actual case debugging deadlock: 1. Use threadapplyallbt to print the stack; 2. Check the thread status; 3. Single-step the main thread; 4. Use condition variables to coordinate access to solve the deadlock.

Is the clock app missing from your phone? The date and time will still appear on your iPhone's status bar. However, without the Clock app, you won’t be able to use world clock, stopwatch, alarm clock, and many other features. Therefore, fixing missing clock app should be at the top of your to-do list. These solutions can help you resolve this issue. Fix 1 – Place the Clock App If you mistakenly removed the Clock app from your home screen, you can put the Clock app back in its place. Step 1 – Unlock your iPhone and start swiping to the left until you reach the App Library page. Step 2 – Next, search for “clock” in the search box. Step 3 – When you see “Clock” below in the search results, press and hold it and

How to use LeakSanitizer to debug C++ memory leaks? Install LeakSanitizer. Enable LeakSanitizer via compile flag. Run the application and analyze the LeakSanitizer report. Identify memory allocation types and allocation locations. Fix memory leaks and ensure all dynamically allocated memory is released.

This article introduces shortcuts for Go function debugging and analysis, including: built-in debugger dlv, which is used to pause execution, check variables, and set breakpoints. Logging, use the log package to record messages and view them during debugging. The performance analysis tool pprof generates call graphs and analyzes performance, and uses gotoolpprof to analyze data. Practical case: Analyze memory leaks through pprof and generate a call graph to display the functions that cause leaks.

Efficiently debug Lambda expressions: IntelliJ IDEA Debugger: Set breakpoints on variable declarations or methods, inspect internal variables and state, and see the actual implementation class. Java9+JVMTI: Connect to the runtime JVM to obtain identifiers, inspect bytecode, set breakpoints, and monitor variables and status during execution.

Concurrency testing and debugging Concurrency testing and debugging in Java concurrent programming are crucial and the following techniques are available: Concurrency testing: Unit testing: Isolate and test a single concurrent task. Integration testing: testing the interaction between multiple concurrent tasks. Load testing: Evaluate an application's performance and scalability under heavy load. Concurrency Debugging: Breakpoints: Pause thread execution and inspect variables or execute code. Logging: Record thread events and status. Stack trace: Identify the source of the exception. Visualization tools: Monitor thread activity and resource usage.

Tools for debugging PHP asynchronous code include: Psalm: a static analysis tool that can find potential errors. ParallelLint: A tool that inspects asynchronous code and provides recommendations. Xdebug: An extension for debugging PHP applications by enabling a session and stepping through the code. Other tips include using logging, assertions, running code locally, and writing unit tests.

Common PHP debugging errors include: Syntax errors: Check the code syntax to make sure there are no errors. Undefined variable: Before using a variable, make sure it is initialized and assigned a value. Missing semicolons: Add semicolons to all code blocks. Function is undefined: Check that the function name is spelled correctly and make sure the correct file or PHP extension is loaded.
