azure-samples / laravel-tasks Goto Github PK
View Code? Open in Web Editor NEWA simple Laravel application that demonstrates how to build data-driven PHP apps in Azure App Service.
License: MIT License
A simple Laravel application that demonstrates how to build data-driven PHP apps in Azure App Service.
License: MIT License
See discussion here: laravel/framework#23948 . The provided workaround (adding "modes" array to MySQL config) seems to have fixed the problem.
When running this command you get the error below.
php artisan migrate
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER' (SQL: select * from information_schema.tables where table_schema
= sampledb and table_name = migrations)
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'
MySQL version: mysql Ver 8.0.12 for Win64 on x86_64 (MySQL Community Server - GPL)
PHP version: PHP 7.2.9 (cli) (built: Aug 15 2018 23:10:01) ( ZTS MSVC15 (Visual C++ 2017) x64 )
The laravel-tasks project is four years old. That project requires Laravel 5.4 and PHP 5.6. Both are old. The current mainstream PHP version is 7.4. Laravel is version 8.
The azure command is specifying PHP 7.2 which is not supported by the project.
You will need to download the project to your local system, patch and update, and then deploy with the patched version. The error that you have is caused by incompatibilities with composer. You will need to run composer update which will fail.
Unless you are experienced with Laravel and PHP, you have to pick a different project to learn from. or you will run into issues.
This is when I try to deploy Laravel to a windows web app; I chooses win to change to root directory to ../public
I also followed Configure a PHP app for Azure App Service
...
Copying file: 'app\Http\Livewire\Rbac\Users.php'
Copying file: 'app\Http\Middleware\Authenticate.php'
Copying file: 'app\Http\Middleware\EncryptCookies.php'
Copying file: 'app\Http\Middleware\PreventRequestsDuringMaintenance.php'
Copying file: 'app\Http\Middleware\RedirectIfAuthenticated.php'
Omitting next output lines...
Looking for app.js/server.js under site root.
Missing server.js/app.js files, web.config is not generated
The package.json file does not specify node.js engine version constraints.
The node.js application will run with the default node.js version 0.10.40.
Selected npm version 1.4.28
Running "C:\Program Files (x86)\nodejs\0.10.40\node.exe" "C:\Program Files (x86)\npm\1.4.28\node_modules\npm\bin\npm-cli.js" install --production
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (C:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:260:10)
npm ERR! at C:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:203:12
An error has occurred during web site deployment.
npm ERR! at saved (C:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\npm-registry-client\lib\get.js:167:7)
npm failed
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\nodejs\\0.10.40\\node.exe" "C:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! cwd C:\home\site\wwwroot
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code E405
Missing server.js/app.js files, web.config is not generated\r\nnpm ERR! Error: Method Not Allowed\r\nnpm ERR! at errorResponse (C:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:260:10)\r\nnpm ERR! at C:\Program Files (x86)\npm\1.4.28\node_modules\npm\lib\cache\add-named.js:203:12\r\nnpm ERR! at saved (C:\Program Files (x86)\npm\1.4.28\node_modules\npm\node_modules\npm-registry-client\lib\get.js:167:7)\r\nnpm ERR! at Object.oncomplete (fs.js:108:15)\r\nnpm ERR! If you need help, you may report this *entire* log,\r\nnpm ERR! including the npm and node versions, at:\r\nnpm ERR! <http://github.com/npm/npm/issues>\r\n\r\nnpm ERR! System Windows_NT 6.2.9200\r\nnpm ERR! command "C:\\Program Files (x86)\\nodejs\\0.10.40\\node.exe" "C:\\Program Files (x86)\\npm\\1.4.28\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"\r\nnpm ERR! cwd C:\home\site\wwwroot\r\nnpm ERR! node -v v0.10.40\r\nnpm ERR! npm -v 1.4.28\r\nnpm ERR! code E405\r\nC:\Program Files (x86)\SiteExtensions\Kudu\92.30310.5111\bin\Scripts\starter.cmd bash deploy.sh
hope someone has a fix for this
my project showing me 403 error
I've been following along with the tutorial.
When first git push
ing the repo to azure, I run into this problem:
...
remote: Copying file: 'config/mail.php'
remote: Omitting next output lines...
remote: Running composer install
remote: ...
remote: Loading composer repositories with package information
remote: Installing dependencies (including require-dev) from lock file
remote:
remote:
remote: [ErrorException]
remote: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
remote:
remote:
remote: install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
remote:
remote: An error has occurred during web site deployment.
remote: composer failed
remote: Deployment Logs : 'https://my.scm.azurewebsites.net/newui/jsonviewer?view_url=/api/deployments/somelonghash/log'
To https://my.scm.azurewebsites.net/my.git
* [new branch] HEAD -> master
By the way, the section Create a web app says
The runtime is set to PHP|7.0
and yet the Azure CLI command below it sets --runtime "PHP|7.3"
The root level .htaccess file in this sample project does not work for me with a fresh Laravel 5.7 instillation on Azure Web App (Linux). Accessing the Laravel registration or login pages resulted in 404 on css and js resources. I found the below line needs to be modified:
RewriteRule ^.*$ /public/$1 [NC,L,QSA]
Replacing it with the following works:
RewriteRule ^(.*)$ /public/$1 [NC,L,QSA]
This fixes the problem, however I also noticed that directly accessing mydomain.com/public is still also possible. I'm not sure how to prevent accessing mydomain.com/public in the browser while also allowing mydomain.com to serve public subdirectory content. I suppose this isn't an emergency, but I'd rather not have both working. Ideas appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.