-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add macos instruction, update blocks, misc changes #17642
base: master
Are you sure you want to change the base?
Changes from all commits
22d3139
5422adc
70c451f
bd548d8
e817be8
4b0ce1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,28 +42,43 @@ a default build, you will additionally need libxml2 and libsqlite3. | |
|
||
On Ubuntu, you can install these using: | ||
|
||
sudo apt install -y pkg-config build-essential autoconf bison re2c \ | ||
libxml2-dev libsqlite3-dev | ||
```shell | ||
sudo apt install -y pkg-config build-essential autoconf bison re2c libxml2-dev libsqlite3-dev | ||
``` | ||
|
||
On MacOS, you can install these using: | ||
|
||
```shell | ||
brew install autoconf bison re2c iconv | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this enough for a default build with no arguments? E.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just tried to install all of this for the first time and it failed. Tried to install only these and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It indeed needs libxml2 because the xml extensions (except soap and xsl) are all default-enabled. You likely already had libxml2 on your system. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for libsqlite3. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As macos user, I confirm these are necessary. |
||
``` | ||
|
||
On Fedora, you can install these using: | ||
|
||
sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel | ||
```shell | ||
sudo dnf install re2c bison autoconf make libtool ccache libxml2-devel sqlite-devel | ||
``` | ||
|
||
Generate configure: | ||
|
||
./buildconf | ||
```shell | ||
./buildconf | ||
``` | ||
|
||
Configure your build. `--enable-debug` is recommended for development, see | ||
`./configure --help` for a full list of options. | ||
|
||
# For development | ||
./configure --enable-debug | ||
# For production | ||
./configure | ||
```shell | ||
# For development | ||
./configure --enable-debug | ||
# For production | ||
./configure | ||
``` | ||
|
||
Build PHP. To speed up the build, specify the maximum number of jobs using `-j`: | ||
|
||
make -j4 | ||
```shell | ||
make -j$(nproc) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unix(-like) specific. We should either specify other operating systems or keep the original There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would even say it is Linux specific. There is ways to achieve similar results on macOs/BSD (make -j$(sysctl -n hw.ncpu)) but it might be simpler to revert back to just make -j 4 as suggested. |
||
``` | ||
|
||
The number of jobs should usually match the number of available cores, which | ||
can be determined using `nproc`. | ||
|
@@ -76,21 +91,31 @@ successful compilation of the sources to run this test suite. | |
It is possible to run tests using multiple cores by setting `-jN` in | ||
`TEST_PHP_ARGS`: | ||
|
||
make TEST_PHP_ARGS=-j4 test | ||
```shell | ||
make TEST_PHP_ARGS=-j4 test | ||
``` | ||
|
||
Shall run `make test` with a maximum of 4 concurrent jobs: Generally the maximum | ||
number of jobs should not exceed the number of cores available. | ||
|
||
Use `TESTS` variable to tests only specific directories: | ||
|
||
```shell | ||
make TESTS=Zend/tests/throw/ test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can also use |
||
``` | ||
|
||
The [qa.php.net](https://qa.php.net) site provides more detailed info about | ||
testing and quality assurance. | ||
|
||
## Installing PHP built from source | ||
|
||
After a successful build (and test), PHP may be installed with: | ||
|
||
make install | ||
```shell | ||
make install | ||
``` | ||
|
||
Depending on your permissions and prefix, `make install` may need super user | ||
Depending on your permissions and prefix, `make install` may need superuser | ||
permissions. | ||
|
||
## PHP extensions | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This belongs in your personal gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how people do various smart functions and then say it's not needed now.
I have a project with commited
.idea
folder, I cannot mark it globally ignored.Otherwise one line is not a problem for any project.
Moreover there are about 300 lines with long comments.
And one more thing is gitignore already has definitions for some tools like this:
vim? IDEA doesn't create such files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a problem to remove it and keep
.idea
changes separately from current changes, but it's not convenient as for meThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use
git add -f .idea
if you want to add a file that's globally ignored.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you do have the option to ignore it locally, for only the current .git repo, by adding it to
.git/info/exclude
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although we have
*.swp
and mentioned*~
in the .gitignore. Personally I wouldn't really mind having various editors in .gitignore but don't really care that much as I have it in.git/info/exclude
...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind adding IDEs to the exclude file, but we should add all common ones then. At least
.vscode
, possibly Visual Studio (not sure what files it creates). Newer ones include.zed
and.fleet
, although they are more conservative about creating these directories (only on-demand).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I got
so might make sense to add those. Should be probably a different PR as we shouldn't mix unrelated things together.