Sentora Support Forums

Full Version: Access PHP file directly via http & IP address
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to upload a private PHP file to common folder - public_html; basically I don't want to upload to any website

And I want to access this file via browser in http, may tell me there's any solution?

Like, when I enter IP into address bar of browser, php file will be run & processed


PHP Code:
http://xx.xx.xx.xx/public_html/some.php 


Regards

There's a solution at https://github.com/sentora/sentora-core/...-150398764

Followed guide, may access to TXT files, but error 500 with PHP files

May you tell me?
(11-13-2018, 05:54 PM)7rdoq Wrote: [ -> ]I want to upload a private PHP file to common folder - public_html; basically I don't want to upload to any website

And I want to access this file via browser in http, may tell me there's any solution?

Like, when I enter IP into address bar of browser, php file will be run & processed


PHP Code:
http://xx.xx.xx.xx/public_html/some.php 


Regards

There's a solution at https://github.com/sentora/sentora-core/...-150398764

Followed guide, may access to TXT files, but error 500 with PHP files

May you tell me?

The private way I would do it is is by creating a virtualhost pointing to my local domain TLD.
(Note for below: you can also point the DocumentRoot to a Sentora managed domain path)

Example:
Code:
<VirtualHost *:80>   ServerAdmin admin@testing.local ServerName  testing.local DocumentRoot /var/www/html/testing.local   ErrorLog ${APACHE_LOG_DIR}/testing.local_error.log CustomLog ${APACHE_LOG_DIR}/testing.local_access.log combined   </VirtualHost>

Either add the system to your local domain DNS zones or edit your hosts file from the client system you wish to access the testing :

Linux as root/sudo
Code:
/etc/hosts[code] Windows in notepad as Administrator: (first right-click notepad, run as Administrator, then open: [code]C:\Windows\System32\Drivers\etc\hosts

Mac OSX as root/su
Code:
/private/etc/hosts

Add your server to hosts file:
Code:
192.168.1.200            testing.local

Now your systems within the local domain (if added to DNS zones) or with modified hosts file will reach your server by accessing
Code:
http://testing.local
(11-13-2018, 05:54 PM)7rdoq Wrote: [ -> ]I want to upload a private PHP file to common folder - public_html; basically I don't want to upload to any website

And I want to access this file via browser in http, may tell me there's any solution?

Like, when I enter IP into address bar of browser, php file will be run & processed


PHP Code:
http://xx.xx.xx.xx/public_html/some.php 


Regards

There's a solution at https://github.com/sentora/sentora-core/...-150398764

Followed guide, may access to TXT files, but error 500 with PHP files

May you tell me?

Or, create a 'fake' domain for the user you want to do this with (so it creates the hosting space inside Sentora) and then follow this tutorial:
http://forums.sentora.org/showthread.php?tid=932
If done properly, anybody can use the DNS-Less preview to view their site or files without a domain.