The ThinkPHP framework has a page that requires regular daily access. the server is linux and there are logon restrictions during access. how can this problem be solved?

Source: Internet
Author: User
In the ThinkPHP framework, a page needs to be accessed regularly every day. the server is linux and there are logon restrictions during access. how can I solve the problem of running a PHP program to process data every night?

Currently, it is written in a PHP page in the project framework to access the wget page for linux scheduled tasks.

How can we solve the problem of better implementation of scheduled execution?


Reply to discussion (solution)

Remove the logon restriction and add an IP address in the header to determine that access is not allowed as long as the local IP address is unavailable.

Is my program restricted?

Remove the logon restriction and add an IP address in the header to determine that access is not allowed as long as the local IP address is unavailable.


Because this page is within the project, you cannot remove the logon restrictions for the entire project. if there is a way to remove the current page (inherit Class a and verify whether to log on in class a _ initialize method) can also be used for logon verification


Remove the logon restriction and add an IP address in the header to determine that access is not allowed as long as the local IP address is unavailable.


Because this page is within the project, you cannot remove the logon restrictions for the entire project. if there is a way to remove the current page (inherit Class a and verify whether to log on in class a _ initialize method) can also be used for logon verification


You can directly put this piece in a model or module.
If you cannot change the password and want to log on, you can blacklist yourself, or add a backdoor or an exception to the program.

1. you can use Curl to simulate login
2. remember the login information of an account, get its cookie, use CURLOPT_COOKIE in curl, and then directly access

I think this is a bit difficult for you. generally, if a URI is only displayed in the database operation department, you can simply write a script and run it yourself. why do you have to rely on the original framework? If part of the logic is based on the framework, you can just extract and copy one. it means that automatic script execution will not consume much resources.

I think this is a bit difficult for you. generally, if a URI is only displayed in the database operation department, you can simply write a script and run it yourself. why do you have to rely on the original framework? If part of the logic is based on the framework, you can just extract and copy one. it means that automatic script execution will not consume much resources.





1. you can use Curl to simulate login
2. remember the login information of an account, get its cookie, use CURLOPT_COOKIE in curl, and then directly access








Remove the logon restriction and add an IP address in the header to determine that access is not allowed as long as the local IP address is unavailable.


Because this page is within the project, you cannot remove the logon restrictions for the entire project. if there is a way to remove the current page (inherit Class a and verify whether to log on in class a _ initialize method) can also be used for logon verification


You can directly put this piece in a model or module.
If you cannot change the password and want to log on, you can blacklist yourself, or add a backdoor or an exception to the program.






Is my program restricted?



The solution is simple. I thought too much before adding the controller and method to the exclusion list when determining whether to log on...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.