AMPLE
↓ Downloadتحميل
Guidesالأدلة

Step by step with AMPLE

خطوة بخطوة مع AMPLE

Short, practical guides for the things you do most: start a project, connect a database, test emails, debug, share your work, and move over from XAMPP.

أدلة قصيرة وعملية لأكثر ما تفعله: بدء مشروع، وربط قاعدة بيانات، وتجربة الرسائل، وتصحيح الأخطاء، ومشاركة عملك، والانتقال من XAMPP.

1Your first siteموقعك الأول

  1. Make sure AMPLE is running: in the panel, Home should say Everything is running. If not, press Start all.
  2. Create a folder htdocs\hello inside AMPLE (in the panel: Sites → New site, or ample sites new hello).
  3. Inside it, create index.php:
  1. تأكد أن AMPLE يعمل: في اللوحة يجب أن تظهر في الرئيسية عبارة Everything is running. وإن لم تظهر، اضغط Start all.
  2. أنشئ مجلداً htdocs\hello داخل AMPLE (من اللوحة: Sites ← New site، أو ample sites new hello).
  3. أنشئ بداخله ملف index.php:
<?php echo "Hello!";

Now open http://hello.localhost. That's it: every folder in htdocs is a site, with no setup and no admin rights. It also opens at http://localhost/hello/.

افتح الآن http://hello.localhost. هذا كل شيء: كل مجلد في htdocs هو موقع، دون أي إعداد ودون صلاحيات مدير. ويفتح أيضاً على http://localhost/hello/.

2Laravel

  1. Make sure php and composer work in a terminal: run ample path add once, then open a new terminal.
  2. Create the project inside htdocs:
  1. تأكد أن php و composer يعملان في الطرفية: نفّذ ample path add مرة واحدة، ثم افتح طرفية جديدة.
  2. أنشئ المشروع داخل htdocs:
cd C:\ample\htdocs
composer create-project laravel/laravel shop
  1. Open http://shop.localhost. AMPLE sees artisan and serves the public folder automatically.
  2. Connect the database in .env, then run the migrations:
  1. افتح http://shop.localhost. يرى AMPLE ملف artisan فيعرض المجلد public تلقائياً.
  2. اربط قاعدة البيانات في ملف .env، ثم نفّذ الترحيلات:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=shop
DB_USERNAME=root
DB_PASSWORD=
ample db new shop
php artisan migrate
Emails from Laravel

Point Laravel at Mailpit and every email lands in your local inbox. See Test emails with Mailpit.

الرسائل من Laravel

وجّه Laravel إلى Mailpit فتصل كل رسالة إلى صندوق بريدك المحلي. راجع تجربة الرسائل مع Mailpit.

Using C:\ample above as the install folder; use yours if you picked another one.

استخدمنا C:\ample أعلاه كمجلد التثبيت؛ استخدم مجلدك إن اخترت غيره.

3WordPress

  1. Download WordPress from wordpress.org and unzip it to htdocs\blog.
  2. Create a database named blog in phpMyAdmin, or run ample db new blog.
  3. Open http://blog.localhost and use host 127.0.0.1, user root, no password.
  1. نزّل WordPress من wordpress.org وفك ضغطه في htdocs\blog.
  2. أنشئ قاعدة بيانات باسم blog في phpMyAdmin، أو نفّذ ample db new blog.
  3. افتح http://blog.localhost واستخدم العنوان 127.0.0.1 والمستخدم root دون كلمة مرور.

Password-reset emails and notifications from WordPress land in Mailpit with no setup, because WordPress uses PHP's mail().

تصل رسائل استعادة كلمة المرور والتنبيهات من WordPress إلى Mailpit دون أي إعداد، لأن WordPress يستخدم الدالة mail().

4Connect PHP to the databaseربط PHP بقاعدة البيانات

MariaDB runs on 127.0.0.1, port 3306, user root, no password (unless you changed it with ample password).

يعمل MariaDB على 127.0.0.1، المنفذ 3306، المستخدم root، دون كلمة مرور (إلا إذا غيّرتها بـ ample password).

$pdo = new PDO("mysql:host=127.0.0.1;dbname=shop;charset=utf8mb4", "root", "");
Always use utf8mb4

so Arabic text and emoji are stored correctly. ample db new NAME creates databases in utf8mb4 already.

استخدم utf8mb4 دائماً

ليُحفظ النص العربي والرموز التعبيرية بشكل صحيح. ينشئ ample db new NAME قواعد البيانات بـ utf8mb4 مسبقاً.

Use 127.0.0.1, not localhost, as the host: PHP on Windows connects to "localhost" through 127.0.0.1 anyway, and the accounts AMPLE creates are set up for it.

استخدم 127.0.0.1 لا localhost كعنوان: فـ PHP على Windows يتصل بـ «localhost» عبر 127.0.0.1 على أي حال، والحسابات التي ينشئها AMPLE مُعدّة لذلك.

5Test emails with Mailpitتجربة الرسائل مع Mailpit

Mailpit is a fake mail server inside AMPLE. Every email your code sends is caught and shown in its inbox, so you see exactly what your users would receive (subject, HTML, attachments) without anything reaching a real person. Any recipient address works, even made-up ones. Read them at http://localhost/mailpit/ or under Mail in the panel.

Mailpit خادم بريد وهمي داخل AMPLE. كل رسالة يرسلها كودك يلتقطها ويعرضها في صندوق بريده، فترى بالضبط ما سيصل لمستخدميك (العنوان و HTML والمرفقات) دون أن يصل شيء لأي شخص حقيقي. يقبل أي عنوان مستلم، حتى العناوين المخترعة. اقرأ الرسائل على http://localhost/mailpit/ أو من البريد في اللوحة.

Settings for any app

الإعدادات لأي تطبيق

SettingالإعدادValueالقيمة
SMTP hostخادم SMTP127.0.0.1
SMTP portمنفذ SMTP1025
Username / passwordالمستخدم / كلمة المرورnone (any value also works)لا يوجد (وأي قيمة تعمل أيضاً)
Encryptionالتشفيرnone (no SSL / TLS)بدون (لا SSL ولا TLS)
Inboxصندوق البريدhttp://localhost/mailpit/

Plain PHP: mail()

PHP العادي: mail()

Works with no setup: AMPLE already points PHP at Mailpit in php.ini.

تعمل دون أي إعداد: AMPLE يوجّه PHP إلى Mailpit مسبقاً في php.ini.

<?php
mail('test@example.com', 'Hello', 'It works!');

Laravel

In your project's .env (older Laravel versions use MAIL_ENCRYPTION=null instead of MAIL_SCHEME):

في ملف .env في مشروعك (نسخ Laravel الأقدم تستخدم MAIL_ENCRYPTION=null بدلاً من MAIL_SCHEME):

MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_SCHEME=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"

Clear the cached config, then send a test email from Tinker:

امسح الإعدادات المخزنة، ثم أرسل رسالة تجريبية من Tinker:

php artisan config:clear
php artisan tinker
> Mail::raw('It works!', fn ($m) => $m->to('test@example.com')->subject('Hello'));

Symfony

In .env.local:

في ملف .env.local:

MAILER_DSN=smtp://127.0.0.1:1025

PHPMailer

Point it at Mailpit with no login and no encryption:

وجّهه إلى Mailpit دون تسجيل دخول ودون تشفير:

$mail = new PHPMailer\PHPMailer\PHPMailer(true);
$mail->isSMTP();
$mail->Host = '127.0.0.1';
$mail->Port = 1025;
$mail->SMTPAuth = false;
$mail->SMTPAutoTLS = false;
$mail->setFrom('hello@example.com', 'My App');
$mail->addAddress('test@example.com');
$mail->Subject = 'Hello';
$mail->Body = 'It works!';
$mail->send();

WordPress

Nothing to do: WordPress uses mail(). If an SMTP plugin is installed, give it the settings above.

لا شيء تفعله: يستخدم WordPress الدالة mail(). وإن كانت لديك إضافة SMTP فأعطها الإعدادات أعلاه.

From the terminal

من الطرفية

ample mail          # the latest emails in Mailpit
ample mail test     # send a test email
ample mail clear    # delete them all
Emails do not arrive?

Make sure Mailpit is running in the panel, and that the port in your app is 1025 (or the SMTP port you set in Settings). Log Doctor shows Mailpit errors too.

لا تصل الرسائل؟

تأكد أن Mailpit يعمل في اللوحة، وأن المنفذ في تطبيقك هو 1025 (أو منفذ SMTP الذي ضبطته في الإعدادات). يعرض Log Doctor أخطاء Mailpit أيضاً.

6Switch the PHP versionتبديل نسخة PHP

In the panel open PHP, press Show available versions, download the one you need and make it active. Or from a terminal:

في اللوحة افتح PHP، واضغط Show available versions، وحمّل النسخة التي تحتاجها واجعلها النشطة. أو من الطرفية:

ample php-list            # installed versions (* = active)
ample php-add 8.4         # download PHP 8.4 from windows.php.net
ample php-compare 8.4     # what would change (changes nothing)
ample php-use 8.4         # switch, carrying over extensions and settings

Your extensions and php.ini changes follow you to the new version, and Apache restarts on its own. Switch back the same way whenever you like.

تنتقل إضافاتك وتعديلات php.ini معك إلى النسخة الجديدة، ويُعاد تشغيل Apache تلقائياً. ويمكنك العودة بالطريقة نفسها متى شئت.

7Debug with Xdebug and VS Codeتصحيح الأخطاء بـ Xdebug و VS Code

  1. Run ample xdebug on. AMPLE downloads the Xdebug build that matches your active PHP.
  2. In VS Code install the PHP Debug extension and add a launch configuration on port 9003:
  1. نفّذ ample xdebug on. يحمّل AMPLE نسخة Xdebug المطابقة لنسخة PHP النشطة.
  2. في VS Code ثبّت إضافة PHP Debug وأضف إعداد تشغيل على المنفذ 9003:
{
  "version": "0.2.0",
  "configurations": [
    { "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003 }
  ]
}
  1. Press F5, set a breakpoint and open the page.
  2. Turn it off afterwards so pages run at full speed: ample xdebug off.
  1. اضغط F5، وضع نقطة توقف، وافتح الصفحة.
  2. أطفئه بعدها لتعمل الصفحات بكامل سرعتها: ample xdebug off.

8Import a big .sql fileاستيراد ملف .sql كبير

phpMyAdmin has upload limits. AMPLE's import has none: any size, with progress. .sql.gz and .zip files work too.

لـ phpMyAdmin حدود في حجم الرفع. أما استيراد AMPLE فليس له حدود: بأي حجم ومع شريط تقدّم. وتعمل ملفات .sql.gz و .zip أيضاً.

ample import C:\Users\you\Downloads\shop.sql shop

9HTTPS with a padlockHTTPS مع القفل

  1. Turn it on in the panel (Sites → HTTPS) or run ample https on.
  2. Run ample https trust and accept the Windows prompt once (no admin).
  3. Open https://shop.localhost: the padlock is there.
  1. فعّله من اللوحة (Sites ← HTTPS) أو نفّذ ample https on.
  2. نفّذ ample https trust ووافق على رسالة Windows مرة واحدة (دون صلاحيات مدير).
  3. افتح https://shop.localhost: ستجد القفل.
Safe by design

The certificate only works for localhost names, so it cannot be misused for real websites. New sites are added to it automatically. To undo: ample https untrust and ample https off.

آمن من الأساس

تعمل الشهادة لأسماء localhost فقط، فلا يمكن استغلالها لمواقع حقيقية. وتُضاف المواقع الجديدة إليها تلقائياً. وللتراجع: ample https untrust ثم ample https off.

10Back up your databasesنسخ قواعد البيانات احتياطياً

ample backup                       # every database, to backups\NAME-DATE.sql.gz
ample backup shop blog             # only these
ample import backups\FILE.sql.gz   # restore one

Backups are compressed .sql.gz files in the backups folder. Copy them anywhere you like, or import them on another PC that runs AMPLE.

النسخ الاحتياطية ملفات .sql.gz مضغوطة في المجلد backups. انسخها إلى أي مكان، أو استوردها على جهاز آخر يعمل عليه AMPLE.

11Share a site with a public linkمشاركة موقع برابط عام

Show a site to a client, try it on your phone over 4G, or receive a webhook (payments, GitHub…): AMPLE gives one site a public https://….trycloudflare.com address through a Cloudflare Quick Tunnel. Free, no account, no router settings: a small program from Cloudflare (cloudflared) connects from your computer to Cloudflare, and visitors reach your site through it.

اعرض موقعاً على عميلك، أو جرّبه على جوالك عبر 4G، أو استقبل Webhook (الدفع، GitHub…): يعطي AMPLE موقعاً واحداً عنواناً عاماً https://….trycloudflare.com عبر Cloudflare Quick Tunnel. مجاناً، ودون حساب، ودون إعدادات في الراوتر: برنامج صغير من Cloudflare اسمه cloudflared يتصل من حاسوبك إلى Cloudflare، ويصل الزوار إلى موقعك من خلاله.

  1. In the panel open Sites and press Share next to a site, or run ample share shop.
  2. The first time only, AMPLE downloads cloudflared (official, signed by Cloudflare, about 53 MB) and checks it.
  3. After a few seconds you get the link. Copy it and send it to anyone.
  4. Press Stop sharing, run ample share stop, stop Apache or close the panel: the link stops working at once.
  1. في اللوحة افتح Sites واضغط Share بجانب الموقع، أو نفّذ ample share shop.
  2. في المرة الأولى فقط، يحمّل AMPLE برنامج cloudflared (رسمي، وموقّع من Cloudflare، حوالي 53 MB) ويتحقق منه.
  3. بعد ثوانٍ تحصل على الرابط. انسخه وأرسله لمن تريد.
  4. اضغط إيقاف المشاركة، أو نفّذ ample share stop، أو أوقف Apache، أو أغلق اللوحة: يتوقف الرابط فوراً.

What is public and what stays private

ما الذي يصبح عاماً وما الذي يبقى خاصاً

Publicعامonly the site you shareالموقع الذي تشاركه فقط
Always privateخاص دائماًphpMyAdmin, the dashboard, Mailpit, phpinfophpMyAdmin والداشبورد و Mailpit و phpinfo
Passwordكلمة السرoptional: visitors type the user guest and your passwordاختيارية: يكتب الزائر المستخدم guest وكلمة السر
Addressالعنوانrandom, different every time you shareعشوائي، ويتغير في كل مشاركة
Visitsالزياراتwritten toتُسجَّل في logs\share\access.log

With a password

مع كلمة سر

ample share shop --password=my-secret

Laravel

If links or images point back to localhost, set APP_URL in .env to the public link while sharing (then php artisan config:clear). If pages load without styles (mixed content), trust the tunnel:

إذا كانت الروابط أو الصور تعود إلى localhost، اضبط APP_URL في ملف .env على الرابط العام أثناء المشاركة (ثم php artisan config:clear). وإذا ظهرت الصفحات دون تنسيق (محتوى مختلط)، اجعل Laravel يثق بالنفق:

APP_URL=https://your-link.trycloudflare.com
// bootstrap/app.php (Laravel 11+): trust the tunnel, so links use https
->withMiddleware(function (Middleware $middleware) {
    $middleware->trustProxies(at: '*');
})

WordPress

WordPress redirects to the address it was installed with. To open it through the link, add this to wp-config.php while sharing:

يعيد WordPress التوجيه إلى العنوان الذي ثُبّت عليه. لفتحه عبر الرابط، أضف هذا إلى wp-config.php أثناء المشاركة:

define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST']);
For demos and tests, not hosting

The link works only while your computer and AMPLE are on, the address changes every time, and Cloudflare gives no guarantee for quick tunnels. Uploads through the link are limited to 100 MB per request.

للعرض والتجربة، لا للاستضافة

يعمل الرابط فقط وحاسوبك و AMPLE يعملان، ويتغير العنوان في كل مرة، ولا تقدّم Cloudflare ضماناً للأنفاق السريعة. وحجم الرفع عبر الرابط محدود بـ 100 MB لكل طلب.

12Move from XAMPPالانتقال من XAMPP

AMPLE never writes into the XAMPP folder: projects are copied, and databases are exported from a temporary copy of mysql\data, opened with XAMPP's own MariaDB. Every step shows a plan first and only acts when you add --yes.

لا يكتب AMPLE أبداً داخل مجلد XAMPP: تُنسخ المشاريع، وتُصدَّر قواعد البيانات من نسخة مؤقتة من mysql\data تُفتح بـ MariaDB الخاص بـ XAMPP نفسه. كل خطوة تعرض خطة أولاً، ولا تنفّذ إلا عندما تضيف --yes.

  1. See what can be imported (read-only; Log Doctor also reads XAMPP's logs):
  1. اعرف ما يمكن استيراده (للقراءة فقط؛ ويقرأ Log Doctor سجلات XAMPP أيضاً):
ample xampp scan
ample xampp scan --path=D:\xampp     # if XAMPP is in another folder
  1. Import, step by step. Run each one without --yes first to read the plan:
  1. استورد خطوة بخطوة. نفّذ كل أمر دون --yes أولاً لتقرأ الخطة:
ample xampp import projects --yes        # copy htdocs projects (existing AMPLE folders are never overwritten)
ample xampp import databases --yes       # stop MySQL in XAMPP first; databases + non-root users and grants
ample xampp import php 1,3 --yes         # pick which of YOUR php.ini changes to keep
ample xampp import vhosts --yes          # httpd-vhosts.conf -> apache\conf\vhosts (+ NAME.localhost alias)
  1. Changed your mind? Remove everything that was imported (XAMPP is untouched anyway):
  1. غيّرت رأيك؟ احذف كل ما استُورد (XAMPP لم يُلمس أصلاً):
ample xampp undo --yes
Good to know

Only mysql\data is imported (other copies such as data_backup are ignored). Accounts @localhost are also created @127.0.0.1 and @::1, because AMPLE's MariaDB doesn't resolve host names and PHP on Windows connects to "localhost" through 127.0.0.1.

من المفيد أن تعرف

يُستورد mysql\data فقط (وتُتجاهل النسخ الأخرى مثل data_backup). والحسابات @localhost تُنشأ أيضاً بـ @127.0.0.1 و @::1، لأن MariaDB في AMPLE لا يحوّل أسماء الأجهزة، و PHP على Windows يتصل بـ «localhost» عبر 127.0.0.1.