창 서비스를 사용하여 PHP 파일 트리거 (Trigger a php file using window service)


문제 설명

창 서비스를 사용하여 PHP 파일 트리거 (Trigger a php file using window service)

메일을 보내는 데 사용했던 php 파일이 서버에 있습니다. 하루 중 특정 시간에 해당 파일을 실행하여 메일을 보내도록 하고 싶습니다. 그래서 나는 트리거할 윈도우 서비스를 만들 계획을 세웠습니다. 하지만 그것을 하는 방법과 윈도우 서비스에서 URL을 언급하는 방법을 모릅니다. 따라서 링크나 아이디어를 공유하면 저에게 더 도움이 됩니다.


참조 솔루션

방법 1:

Create/Run cron jobs using ssh:

login in to server using ssh ..

type crontab ‑e
*/1 * * * * php SCRIPT_NAME ‑‑> this will run every minute
00 00 * * * php SCRIPT_NAME ‑‑> this will run at 12 AM every day
*/5 * * * * php SCRIPT_NAME ‑> every 5 minutes
if its giving you an option to select editor after crontab ‑e command, then select vim or vim basic
(To run python scripts replace php with python e.g. */1 * * * * python SCRIPT_NAME ‑‑> this will run every minute)
7,22,37,52 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1 ‑‑‑> cron will run on 7th, 22nd, 37th and 52nd min of every hour

방법 2:

If you want to call a website from C# all you should need is

WebRequest webRequest = WebRequest.Create("URL_HERE");
WebResponse webResp = webRequest.GetResponse();

replace the URL_HERE in above example with your URL.

(by KarthikWaqas Shahidmega6382)

참조 문서

  1. Trigger a php file using window service (CC BY‑SA 2.5/3.0/4.0)

#PHP #window #windows-services #service






관련 질문

bash의 rsync가 php 생성 --exclude-from 파일을 구문 분석하지 않음 (rsync in bash not parsing php-generated --exclude-from file)

PHP 배열 값 저장 (PHP Save array value)

검색으로 배열에서 특정 데이터 가져오기 (get specific datas from a array by a search)

창 서비스를 사용하여 PHP 파일 트리거 (Trigger a php file using window service)

yii2 컨트롤러 작업 주입은 어떻게 작동합니까? (How does the yii2 Controller action injection works)

php와 drupal을 사용하여 pdf를 텍스트로 변환 (pdf to text convert using php and drupal)

PHP에서 카테고리 및 하위 카테고리 목록 검색 (Retrieve Category & Subcategory list in PHP)

PDO - COUNT(*) 결과를 얻습니까? (PDO - get the result of a COUNT(*)?)

PHP - MySQL 쿼리 문제 (PHP - Mysql query problem)

제품용 Reviews.io API의 Foreach 루프 (Foreach loop in Reviews.io API for Products)

숫자를 나누고 점 뒤에 하나의 숫자를 유지하십시오. (Split the number and keep one number after the dot)

내 메시지 입력이 데이터베이스에 들어가지 않습니다. (My message input doesn't get into database)







코멘트