Jump to content

Laravel Valet with ProcessWire


LostKobrakai
 Share

Recommended Posts

Just to add that here. The driver can be installed manually until and if the pr does get merged into valet. Just put the ProcessWireValetDriver.php of the pr into the ~/.valet/Drivers folder and start your ProcessWire project. 

  • Like 3
Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 2 months later...

@Rudy I did take a look at your take at it and the subfolder option didn't seem to work. 

I've now enhanced it to be configurable to different optional subfolders to look for a ProcessWire installation. I've also taken the trailingSlash part out, because ProcessWire does not enforce trailing slashes, but it can do it on it's own if you want it to.

https://gist.github.com/LostKobrakai/5328d6f64e9dc06a8776d0231c6628c6

  • Like 2
Link to comment
Share on other sites

to make file uploads work i had to make those adjustments on my laragon + win10:

// php.ini (right click on laragon tray > php > php.ini
date.timezone = Europe/Vienna // uncomment and set
always_populate_raw_post_data = -1 // uncomment

don't forget to reload laragon :)

awesome tool so far, thanks for sharing @LostKobrakai and @pwired

 

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

@LostKobrakai, when you have a chance, could you test this on your Valet/PW install. 

do a 

var_dump(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));

and visit a page that has dash in the segment name.

on my PW install:

Original URL: http://my.dev/this-and-that/

The var_dump output is "-that"

I ran the same test on my MAMP Pro and Ubuntu server and both comes out as "this-and-that"

Not sure if it's isolated to my Valet or not.

Thanks

Rudy

Link to comment
Share on other sites

  • 1 month later...

Hi,

I am using Laragon (laravel for mac) on Windows but can not solve the mod_rewrite error when installing Processwire 2.7

 

mod_rewrite.jpg

 

I searched with Google but could only find some tips about php.ini and nginx.conf but didnt make the mod_rewrite error go away.

I tried to look inside the list with php extensions to see if it has to be enabled there like with wamp but it seems not to be there in the list.

What needs to be done here ?

 

mod_rewrite2.jpg

 

 

 

Link to comment
Share on other sites

Thanks for your reply LostKobraKai. Ok I clicked on Continue and could finish the installation. So I only have to setup rewrites when I need them. I will be good then for the time being. How to create nginx rewrite rules must be easy to find with Google. I assume I have to put them in nginx.conf

 

conf.jpg

 

 

 

Link to comment
Share on other sites

  • 3 months later...

Just wanted to say thanks for creating the Valet driver - it works well with the latest master and dev branches of PW. It is noticeably faster than MAMP, not to mention much easier to setup - just create a new folder and off you go. Also the ease of setting up SSL for local testing is very unique. I've not used it extensively but this feels like the best local development setup I have tried so far (for performance and ease of setup). Interested to hear if anyone has had any issues using Valet for PW development.

I am also very impressed by homebrew - it has come a long way since my earlier tests and seems to be very solid since turning 1.0 with lots of additional help to make sure you don't mess anything up.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
On 10/15/2016 at 8:29 AM, LostKobrakai said:

@Rudy I did take a look at your take at it and the subfolder option didn't seem to work. 

I've now enhanced it to be configurable to different optional subfolders to look for a ProcessWire installation. I've also taken the trailingSlash part out, because ProcessWire does not enforce trailing slashes, but it can do it on it's own if you want it to.

https://gist.github.com/LostKobrakai/5328d6f64e9dc06a8776d0231c6628c6

I confirm that this version is working on Windows 10, using https://github.com/cretueusebiu/valet-windows

If yours doesn't work, maybe enabling developer mode on Windows is required.

Thanks @LostKobrakai !

Link to comment
Share on other sites

  • 1 year later...

@LostKobrakai thank you so much for your great driver, I use and love it for quite a while now.

I just experienced something weird, and I'm not sure if it has to do something with valet and your driver:

I'm in the need of accessing a non-processwire php file in the processwire root (e.g. domain.test/myfile.php).

On my staging & live server, this works great – on my local dev environment (including valet and your driver), I land on the 404 processwire page.

I tried a few things:

On Staging (with valet):
domain.test/myimage.png -> ✔️
domain.test/custom/myimage.png -> ✔️
domain.test/myfile.php -> 
domain.test/custom/myfile.php ->

On Live Server (apache):
domain.com/myimage.png -> ✔️
domain.com/custom/myimage.png -> ✔️
domain.com/myfile.php -> ✔️
domain.com/custom/myfile.php -> ✔️

Is it possible that it has something to do with valet and the driver? Or could there be other reasons?

Best,
Daniel

Link to comment
Share on other sites

You probably have to change something in your .htaccess file (mod_rewrite). A workaround would be to simply use an empty new template and include() your custom PHP file, then use the PW-generated URL / page-slug to access it.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...