项目放在github,做了一个webhook, 自己的服务器检测来自github的post,如果master有变动,就执行
<code>cd /path; git pull git@ooxxx.com</code>
上面拉取代码没有问题。
最后同时还检测master分支里的compoer.json有改动的时候就执行一次:
<code>php composer.phar update php composer.phar dump-autoload -o</code>
由于来自github的post数据是用apache指定的www-data 执行 git pull(部署的public key也是这个用户)发现并不能执行上面的composer操作,我在服务器上手动操作 composer update 出现下面提示:
···
sudo -u www-data php composer.phar update
Cannot create cache directory /root/.composer/cache/repo/http---packagist.phpcomposer.com/, or directory is not writable. Proceeding without cache
Cannot create cache directory /root/.composer/cache/files/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Updating dependencies (including require-dev)
Generating autoload files
···
同样,我尝试全局安装composer,用 php /usr/local/bin/composer update 也是同样的错误。
在GG上面搜索,尝试了把 /root/.composer 目录改成www-data且 777
<code>root@localhost:~# ls -la ~/.composer/cache total 20 drwxrwxrwx 4 www-data www-data 4096 Dec 30 14:53 . drwxrwxrwx 3 www-data www-data 4096 Dec 30 14:53 .. drwxrwxrwx 2 www-data www-data 4096 Dec 30 14:53 files -rwxrwxrwx 1 www-data www-data 13 Dec 30 14:53 .htaccess drwxrwxrwx 3 www-data www-data 4096 Dec 30 14:53 repo</code>
除此之外 项目根目录的composer.phar和/usr/local/bin/composer 拥有者都设置成为了www-data ,问题依旧。
请教怎么解决。
ps:补充一下,用root 执行 composer update等操作没有任何问题。
回复内容:
项目放在github,做了一个webhook, 自己的服务器检测来自github的post,如果master有变动,就执行
<code>cd /path; git pull git@ooxxx.com</code>
上面拉取代码没有问题。
最后同时还检测master分支里的compoer.json有改动的时候就执行一次:
<code>php composer.phar update php composer.phar dump-autoload -o</code>
由于来自github的post数据是用apache指定的www-data 执行 git pull(部署的public key也是这个用户)发现并不能执行上面的composer操作,我在服务器上手动操作 composer update 出现下面提示:
···
sudo -u www-data php composer.phar update
Cannot create cache directory /root/.composer/cache/repo/http---packagist.phpcomposer.com/, or directory is not writable. Proceeding without cache
Cannot create cache directory /root/.composer/cache/files/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Updating dependencies (including require-dev)
Generating autoload files
···
同样,我尝试全局安装composer,用 php /usr/local/bin/composer update 也是同样的错误。
在GG上面搜索,尝试了把 /root/.composer 目录改成www-data且 777
<code>root@localhost:~# ls -la ~/.composer/cache total 20 drwxrwxrwx 4 www-data www-data 4096 Dec 30 14:53 . drwxrwxrwx 3 www-data www-data 4096 Dec 30 14:53 .. drwxrwxrwx 2 www-data www-data 4096 Dec 30 14:53 files -rwxrwxrwx 1 www-data www-data 13 Dec 30 14:53 .htaccess drwxrwxrwx 3 www-data www-data 4096 Dec 30 14:53 repo</code>
除此之外 项目根目录的composer.phar和/usr/local/bin/composer 拥有者都设置成为了www-data ,问题依旧。
请教怎么解决。
ps:补充一下,用root 执行 composer update等操作没有任何问题。
www-data
没有权限读写 /root
目录。
改下缓存目录。
https://getcomposer.org/doc/03-cli.md#composer-cache-dir

DependencyInjection (DI) inphpenhancescodeflexibilityandtestabilitybydecouplingclassclassfromtheirdependency.1) useConstructSinjectiontopassdependencysviaconstructors, memastikanffullinitialization.2) EmploSetterInjectionfolkforpost-creationdependencyChanges, te

Jerawat disyorkan untuk projek mudah, DependencyInjection Symfony disyorkan untuk projek -projek yang kompleks. 1) Jerawat sesuai untuk projek kecil kerana kesederhanaan dan fleksibiliti. 2) Ketergantungan Symfony sesuai untuk projek besar kerana keupayaannya yang kuat. Apabila memilih, saiz projek, keperluan prestasi dan lengkung pembelajaran perlu diambil kira.

DependencyInjection (DI) inphpisadesignpatternwhereclassdependencyesarePassedToitRatherHancreatedInternally, EnhancingCodeModularityAndtestability.itimprovessoftwarequalyby: 1) enhancingTestThoughThoughtheasyDepleasyDepleasymocking, 2) peningkatanflexabily

DependencyInjection (DI) inphpenhancescodemodularity, testility, andmaintainability.1) itAllowseasyswappingofcomponents, asseeninapaymentgatewayswitch.2) DicanbeimplementedManuallyorviacontainers, withcontainersaddingcomplexitybutidinglargerprarger

TooptimizephpcodeforreducedmemoryusageandexecutionTime, ikuti: 1) userereferencesInsteadofcopylylargedataStructureStructureStructureStoreducemoryconsumption.2)

PhpisusedforsendingemailsduetoitsintegrationWithservermailservicesandexternalsmtpproviders, automatingnotificationsandmarketingcampaigns.1) Setupyourphpenvironmentwithawebserverandphp, Memastikan

Cara terbaik untuk menghantar e -mel ialah menggunakan perpustakaan phpmailer. 1) Menggunakan fungsi mel () adalah mudah tetapi tidak boleh dipercayai, yang boleh menyebabkan e -mel memasuki spam atau tidak dapat dihantar. 2) PHPMailer menyediakan kawalan dan kebolehpercayaan yang lebih baik, dan menyokong surat HTML, lampiran dan pengesahan SMTP. 3) Pastikan tetapan SMTP dikonfigurasi dengan betul dan penyulitan (seperti startTLS atau SSL/TLS) digunakan untuk meningkatkan keselamatan. 4) Untuk sejumlah besar e -mel, pertimbangkan untuk menggunakan sistem giliran mel untuk mengoptimumkan prestasi.

CustomheadersandadvancedfeaturesInphpeMailenhanceFunctialityandreliability.1) customHeadersAddmetadataFortrackingandCategorization.2) htmlemailsallowformattingIntivity.3)


Alat AI Hot

Undresser.AI Undress
Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover
Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool
Gambar buka pakaian secara percuma

Clothoff.io
Penyingkiran pakaian AI

Video Face Swap
Tukar muka dalam mana-mana video dengan mudah menggunakan alat tukar muka AI percuma kami!

Artikel Panas

Alat panas

Penyesuai Pelayan SAP NetWeaver untuk Eclipse
Integrasikan Eclipse dengan pelayan aplikasi SAP NetWeaver.

Notepad++7.3.1
Editor kod yang mudah digunakan dan percuma

EditPlus versi Cina retak
Saiz kecil, penyerlahan sintaks, tidak menyokong fungsi gesaan kod

MinGW - GNU Minimalis untuk Windows
Projek ini dalam proses untuk dipindahkan ke osdn.net/projects/mingw, anda boleh terus mengikuti kami di sana. MinGW: Port Windows asli bagi GNU Compiler Collection (GCC), perpustakaan import yang boleh diedarkan secara bebas dan fail pengepala untuk membina aplikasi Windows asli termasuk sambungan kepada masa jalan MSVC untuk menyokong fungsi C99. Semua perisian MinGW boleh dijalankan pada platform Windows 64-bit.

ZendStudio 13.5.1 Mac
Persekitaran pembangunan bersepadu PHP yang berkuasa
