Comments (8)
Just a question: How do you know you have few PHP users?
There are many static page generators (and some even somewhat influential, like Sculpin and Jigsaw), and people have to build locally and will only deploy static pages. I use Jigsaw which is popular in the Laravel world, and though it might be possible to use continuous deployment with php5.5 it would be so much easier and fast with php7.0+. This is why I think there are virtually no PHP users right now, because noone still uses 5.5.
from build-image.
did you manage to make it work for jigsaw? several days ago tested it, recevie an error in build log, send an email to netlify support, they just told that the composer installed in their dockerfile, but can't be used
the build script that i've tested:
netlify.toml
[build]
command = "composer require tightenco/jigsaw && ./vendor/bin/jigsaw build"
publish = "/build_local"
return an error in build log:
/opt/build/build.sh: line 468: composer: command not found
tried another way
netlify.toml
[build]
command = "sudo apt update && sudo apt install -y composer php && composer require tightenco/jigsaw && ./vendor/bin/jigsaw build"
publish = "/build_local"
return an error in build log:
sudo: no tty present and no askpass program specified
forgot to tell, the same source (jigsaw) works in another cicd hosted
is there a way to make php static generator work in netlify?
from build-image.
@minthemiddle this thread will be a great way to tell if I'm wrong :) I am already surprised by the amount of engagement!
However I have done some formal surveys of build commands our customers use and the php-based frameworks and commands are very rare, is why I made the statement - it is objectively true.
Do I want to support php less? absolutely not! Will there be substantial engineering effort spent on it by Netlify staff vs ruby/node? Probably not in the immediate future - hence my request for PR's ;)
from build-image.
@sugizo what you reported is not what our team said in that support ticket - they just said you can't use sudo, and composer is already supposed to be there - but I am not sure it is. I've reopened your case and we'll take another shot.
Since you didn't respond to our last suggestion in that thread, we assumed you got something working. A "try this to see if you can figure it out" is always open to a response of "I couldn't" if you need more help :)
from build-image.
@fool Thanks for clarification. Will look into how to possibly tweak the build image and might be able to contribute…
from build-image.
pardon, forgot to replied gerald's advice last time, the status of jigsaw's built is published right now, after follow chris advice with:
netlify.toml
[build]
command = "source /opt/buildhome/.phpbrew/bashrc && phpbrew switch 5.6.32 && /opt/buildhome/.phpbrew/bin/composer require tightenco/jigsaw && ./vendor/bin/jigsaw build"
publish = "/build_local"
the different with my previous posted is, i didn't know the full path of composer so that the status is command not found, but now is work well, thx 4 quick respond
from build-image.
@depadiernos could you write this up as a FAQ? It's not really "frequent" but I'd like to get it doc'd somewhere and we talked through this together. Issue will stay open until we improve support but right now it's impossible for someone who doesn't find this thread or ask support how to get composer or php version selection working
from build-image.
Here is my write-up of how to use continuous deployment with Jigsaw (Laravel based):
https://github.com/minthemiddle/netlify-php-cdci-jigsaw
Studying the build image, I really wonder why Netlify installs PHP5
and does not use PHP72
via apt
:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2-cli
(Source: https://www.colinodell.com/blog/201711/installing-php-72)
PHP7
is largely downward compatible and a lot safer and faster than PHP56
.
from build-image.
Related Issues (20)
- Customizable Java version HOT 2
- Latest NPM versions throw an error when workspaces are configured HOT 1
- Missing workdir "/opt/build" in build container.
- Change the way how the elm compiler is installed as it is not compatible with arm64 HOT 2
- Why is the Hugo version out of date so much?
- Add Haldo linting to build image dockerfile HOT 1
- Run the docker image size inside CircleCI instead of github actions
- Container-structure-tests fail for arm64 HOT 2
- Create multiarch images and push them to the dockerhub HOT 5
- Cache Playwright browser dependencies HOT 3
- `target` directory for Rust is not stored
- Local build test fails with podman HOT 1
- Builds fail when using `[email protected]` HOT 5
- Same codebase stopped compiling in version 4.13 HOT 4
- Monorepo project cannot found pnpm HOT 2
- Failed to debug netlify locally HOT 1
- Add Support for .NET 7 HOT 6
- `NETLIFY_USE_PNPM: true` environment var not working after v4.15.0 HOT 1
- Show an understandable error when `getBuildInfo` failed
- Not respecting pnpm version specified in packageManager field of package.json HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from build-image.