feat: adiciona 12 plugins Descomplicar ao marketplace
Plugins: automacao, crm-ops, design-media, dev-tools, gestao, infraestrutura, marketing, negocio, perfex-dev, project-manager, wordpress + hello-plugin (existente). Totais: 83 skills, 44 agents, 12 datasets.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
213
infraestrutura/skills/cwp-php/SKILL.md
Normal file
213
infraestrutura/skills/cwp-php/SKILL.md
Normal file
@@ -0,0 +1,213 @@
|
||||
---
|
||||
name: cwp-php
|
||||
description: CWP PHP version management. PHP Switcher, Selector, configuration. Based on official CWP documentation only. Use when user mentions "php cwp", "versão php", "php selector", "php switcher".
|
||||
author: Descomplicar® Crescimento Digital
|
||||
version: 1.0.0
|
||||
quality_score: 70
|
||||
user_invocable: true
|
||||
desk_task: null
|
||||
---
|
||||
|
||||
# /cwp-php - Gestão PHP CWP (Documentação Oficial)
|
||||
|
||||
Gestão de versões PHP no CWP. **Zero assumptions, zero hallucinations** - apenas informação documentada.
|
||||
|
||||
**REGRA #38 - ZERO INVENCAO:** NUNCA improvisar comandos. Verificar estado actual ANTES de alterar. Pesquisar wiki CWP se necessario. Usar APENAS scripts oficiais.
|
||||
|
||||
---
|
||||
|
||||
## Servidor Alvo
|
||||
|
||||
| Servidor | IP | MCP | User |
|
||||
|----------|-----|-----|------|
|
||||
| **CWP Principal** | 176.9.3.158 | ssh-unified | root |
|
||||
|
||||
---
|
||||
|
||||
## Documentação Base
|
||||
|
||||
- [PHP Selector](https://wiki.centos-webpanel.com/php-selector)
|
||||
- [PHP Version Switcher](https://wiki.centos-webpanel.com/php-version-switcher)
|
||||
- [CWP Scripts](https://wiki.centos-webpanel.com/cwp-scripts)
|
||||
|
||||
---
|
||||
|
||||
## Ferramentas PHP no CWP
|
||||
|
||||
O CWP oferece 3 ferramentas para gerir PHP:
|
||||
|
||||
| Ferramenta | Função |
|
||||
|------------|--------|
|
||||
| **PHP Switcher** | Versão principal do CWP (default para novos clientes) |
|
||||
| **PHP Selector** | Permite diferentes versões por pasta/domínio |
|
||||
| **PHP-FPM Selector** | Para sites que usam PHP-FPM |
|
||||
|
||||
---
|
||||
|
||||
## Versões PHP Disponíveis (Documentadas)
|
||||
|
||||
PHP Selector suporta: **4.4, 5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1**
|
||||
|
||||
---
|
||||
|
||||
## Paths de Configuração
|
||||
|
||||
| Path | Descrição |
|
||||
|------|-----------|
|
||||
| `/usr/local/cwpsrv/htdocs/resources/conf/el7/php_switcher/` | Config CentOS 7 |
|
||||
| `/usr/local/cwpsrv/htdocs/resources/conf/el8/php_switcher/` | Config CentOS 8 |
|
||||
| `/var/log/php-rebuild.log` | Log de compilação PHP |
|
||||
|
||||
---
|
||||
|
||||
## Monitorizar Compilação PHP
|
||||
|
||||
```bash
|
||||
# Ver log em tempo real durante instalação de versão PHP
|
||||
tail -f /var/log/php-rebuild.log
|
||||
|
||||
# Ver log completo
|
||||
cat /var/log/php-rebuild.log
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Scripts Oficiais
|
||||
|
||||
| Script | Descrição |
|
||||
|--------|-----------|
|
||||
| `/scripts/phpfpm_rebuild_user_conf` | Rebuild configuração PHP-FPM de utilizadores |
|
||||
|
||||
```bash
|
||||
sh /scripts/phpfpm_rebuild_user_conf
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## PHP por Pasta (Documentado)
|
||||
|
||||
Cada utilizador pode ter versão PHP diferente por pasta usando `.htaccess`:
|
||||
|
||||
```apache
|
||||
# Exemplo .htaccess para usar PHP específico numa pasta
|
||||
# (configurar via CWP PHP Selector primeiro)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Desactivar Funções Perigosas (Documentado)
|
||||
|
||||
### PHP Switcher
|
||||
|
||||
```bash
|
||||
echo "disable_functions = exec, system, popen, proc_open, shell_exec, passthru, show_source" > /usr/local/php/php.d/disabled_function.ini
|
||||
```
|
||||
|
||||
**Nota:** Cada versão PHP tem caminho diferente.
|
||||
|
||||
---
|
||||
|
||||
## Adicionar Flags de Compilação (Documentado)
|
||||
|
||||
**Ficheiro exemplo CentOS 7 PHP 7.0:**
|
||||
`/usr/local/cwpsrv/htdocs/resources/conf/el7/php_switcher/7.0.ini`
|
||||
|
||||
### Formato
|
||||
|
||||
```ini
|
||||
[nome-unico]
|
||||
default=0
|
||||
option="--enable-opcao"
|
||||
```
|
||||
|
||||
**Aviso documentado:** "CWP update will overwrite these files" - documentar alterações para reaplicar após updates.
|
||||
|
||||
---
|
||||
|
||||
## Verificações
|
||||
|
||||
### Versão PHP Actual
|
||||
|
||||
```bash
|
||||
php -v
|
||||
```
|
||||
|
||||
### Memory Limit
|
||||
|
||||
```bash
|
||||
php -i | grep memory_limit
|
||||
```
|
||||
|
||||
### OPcache Status
|
||||
|
||||
```bash
|
||||
php -i | grep -E 'opcache.enable|opcache.memory_consumption'
|
||||
```
|
||||
|
||||
### Processos PHP-FPM
|
||||
|
||||
```bash
|
||||
ps aux | grep php-fpm | wc -l
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Workflows
|
||||
|
||||
### 1. Verificar Versão PHP
|
||||
|
||||
```bash
|
||||
php -v | head -1
|
||||
```
|
||||
|
||||
### 2. Ver Configuração PHP
|
||||
|
||||
```bash
|
||||
php -i | grep -E 'memory_limit|upload_max|post_max|max_execution'
|
||||
```
|
||||
|
||||
### 3. Rebuild PHP-FPM Config
|
||||
|
||||
```bash
|
||||
sh /scripts/phpfpm_rebuild_user_conf
|
||||
```
|
||||
|
||||
### 4. Monitorizar Instalação de Versão PHP
|
||||
|
||||
```bash
|
||||
tail -f /var/log/php-rebuild.log
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Anti-Patterns (NUNCA FAZER)
|
||||
|
||||
| Anti-Pattern | Risco | Alternativa |
|
||||
|--------------|-------|-------------|
|
||||
| Editar .ini sem documentar | Perdido em update | Documentar alterações |
|
||||
| Compilar PHP manualmente | Conflito com CWP | Usar PHP Selector |
|
||||
| Ignorar php-rebuild.log | Não detectar erros | Monitorizar sempre |
|
||||
|
||||
---
|
||||
|
||||
## Notas Importantes
|
||||
|
||||
1. **PHP Switcher** é a versão default para novos utilizadores
|
||||
2. **PHP Selector** permite versão por pasta
|
||||
3. Updates do CWP podem sobrescrever configurações personalizadas
|
||||
4. Sempre documentar alterações para reaplicar
|
||||
|
||||
---
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] Verificar versão actual (`php -v`)
|
||||
- [ ] Verificar configuração (`php -i`)
|
||||
- [ ] Se alterar, documentar mudanças
|
||||
- [ ] Testar sites após alterações
|
||||
- [ ] Verificar logs se problemas
|
||||
|
||||
---
|
||||
|
||||
**Versão:** 1.0.0 | **Autor:** Descomplicar®
|
||||
**Fonte:** wiki.centos-webpanel.com/php-selector, wiki.centos-webpanel.com/php-version-switcher
|
||||
Reference in New Issue
Block a user